私は友達のリストを取得しようとしています:
private void getFriends(){
JSONObject json_data = null;
try
{
JSONObject response = Util.parseJson(facebook.request("me/friends")); // Get a friend information from facebook
JSONArray jArray = response.getJSONArray("data");
json_data = jArray.getJSONObject(0);
String name = json_data.getString("name");
Log.e("lovehate", name);
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (JSONException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (FacebookError e)
{
e.printStackTrace();
}
}
このコードは IOEXception にヒットします -
08-27 18:00:29.630: D/Facebook-Util(5068): GET URL: https://graph.facebook.com/me/friends?access_token=[REMOVED_ACCESS_TOKEN]&format=json
08-27 18:00:32.390: W/System.err(5068): java.net.UnknownHostException: graph.facebook.com
08-27 18:00:32.400: W/System.err(5068): at java.net.InetAddress.lookupHostByName(InetAddress.java:500)
08-27 18:00:32.400: W/System.err(5068): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:297)
08-27 18:00:32.400: W/System.err(5068): at java.net.InetAddress.getAllByName(InetAddress.java:256)
08-27 18:00:32.400: W/System.err(5068): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:69)
私の権限のリストは次のようになります。
facebook.authorize(this, new String[] {}, new DialogListener() {
@Override
public void onComplete(Bundle values) {
Log.e("tag","new auth stored");
SharedPreferences.Editor editor = mPrefs.edit();
editor.putString("access_token", facebook.getAccessToken());
editor.putLong("access_expires", facebook.getAccessExpires());
editor.commit();
}