0

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 get the access token but next problem is to get the basic information of the user.

ekjyot
  • 2,247
  • 7
  • 39
  • 63

1 Answers1

4

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

Community
  • 1
  • 1
Venky
  • 11,049
  • 5
  • 49
  • 66