0

当我从 Facebook 图表执行 get 时,我得到了一个复杂的字符串。

有没有办法将其分解为“图形用户”?

例如:

{"data":[{"id":"112221111"},{"id":"112221111"},{"id":"112221111"},{"score":{"data":[{"score":77777,"user":{"id":"5551","name":"כr"},"application":{"id":"3463464363636336","namespace":"tomatosmasher","name":"Tomato Smasher"}]},"id":"667677577575","installed":true},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},

我正在使用的代码

                String currentUserFBID = user.getId();
                String currentUserAccessToken = Session.getActiveSession().getAccessToken();

// Execute the HTTP Get to our server for the scores of the user's friends
                HttpClient client = new DefaultHttpClient();
                String getURL = "https://graph.facebook.com/" + currentUserFBID + "/friends?access_token=" + currentUserAccessToken + "&fields=installed,score";
                HttpGet get = new HttpGet(getURL);
                HttpResponse responseGet = client.execute(get);

// Parse the response
                HttpEntity responseEntity = responseGet.getEntity();
                String response = EntityUtils.toString(responseEntity);

谢谢你。

4

1 回答 1

0

是的,dmon 是正确的

我需要转换为 JSON

并通过本教程处理它。

http://www.androidhive.info/2012/01/android-json-parsing-tutorial/

于 2013-03-31T19:53:34.380 回答