Facebook 好友信息与 Facebook Android SDK、JSON 破坏
陷入了困境。我对安卓完全陌生。 我使用 Facebook Android SDK https://github.com/facebook/facebook-android-sdk
我遵循了本教程 http://www.integratingstuff.com/2010/10/14/integrating-facebook-into-an-android-application/
这可以帮助我登录并发布到用户的墙上。现在我想收集朋友的信息。
从本主题 适用于 Android 的 Facebook API:如何获取有关用户好友的扩展信息? 我找到了一个简单的方法来做到这一点。
Bundle bdle=new Bundle();
bdle.putString("fields","birthday");
JSONObject json = Util.parseJson(facebook.request("me/friends",bdle));
现在,当我打印这个 json 时,我可以看到 id 和出生日期。现在我找不到分离它们的方法,也没有在搜索中找到任何内容。它给了我所有朋友的 ID 和出生日期。类似的东西:
{"data":[{"id":"12345","birthday":03/29"},{"id":"12678","birthday":06/22"}],.. ......
我更喜欢这个,因为它可以防止应用程序获取单个朋友的 ID 来获取单个日期,而是完全为我提供。
现在请帮我打破这个 json 并将这些信息分成两个数组,例如 a[1]="12345";b[1]="03/29"
如果有人可以在 facebook 上为我提供任何简单的示例/教程链接与 android 集成,特别是以异步方式集成,这将是一个很大的帮助。
Got stuck in a situation. I'm totally new to android.
I used Facebook Android SDK https://github.com/facebook/facebook-android-sdk
I followed this tutorial http://www.integratingstuff.com/2010/10/14/integrating-facebook-into-an-android-application/
this helps me to log in and post to user's wall. Now I want to collect friends' information.
From this topic Facebook API for Android: how to get extended info regarding user`s friends?
I found a simple way to do that.
Bundle bdle=new Bundle();
bdle.putString("fields","birthday");
JSONObject json = Util.parseJson(facebook.request("me/friends",bdle));
Now when I print this json,I can see id and birth dates. Now I can't find a way to separate them and also not found anything on search. It gives me all friends' ID and birth dates all together. something like :
{"data":[{"id":"12345","birthday":03/29"},{"id":"12678","birthday":06/22"}],.......
I preferred this ,because it prevents application to fetch a single friend's id to get a single date,rather provides me altogether.
Now please help me to break this json and separate this information into two array,like a[1]="12345";b[1]="03/29"
And if anyone can provide me any simple example/tutorial link on facebook integration with android specially in asynchronous way that would be a great help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(在问题编辑中回答。已转换为社区 wiki 答案。请参阅 问题没有答案,但问题在评论中解决(或在聊天中扩展))
OP 写道:
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote: