How to get the basic information like first name, last name, user id from facebook access token in android. I am able to login and 开发者_JAVA技巧get the access token but next problem is to get the basic information of the user.
Check this Code for Getting User Information ;
Bundle params1 = new Bundle();
params1.putString("fields","picture");
Log.v("sss", authenticatedFacebook.request("me"));
JSONObject jObject = new JSONObject(authenticatedFacebook.request("me"));
String id=jObject.getString("id");
String name=jObject.getString("name");
String email=jObject.getString("email");
try {
URL img_value = new URL("http://graph.facebook.com/"+id+"/picture?type=large");
} catch (MalformedURLException e) {}
try {
Bitmap mIcon1 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream());
} catch (IOException e) {}
Code for getting id , name , email of Logged user in Facebook and also image of the logged user.
If you need further help in Facebook check this links
Graph Api in Facebook
Facebook Birthday Details of friends
Ensure you added required Permission in this Permissions
精彩评论