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.
Asked
Active
Viewed 1,927 times
0
-
http://stackoverflow.com/questions/7131666/get-user-basic-information-using-facebook-login-button-plugin – Nikunj Patel Oct 13 '11 at 10:39
-
[Have a look here](http://stackoverflow.com/questions/7345535/android-how-to-get-user-about-me-info-from-facebook/7345618#7345618) – Adil Soomro Oct 13 '11 at 10:46
-
@ekjyot have you checked my post?? – Venky Oct 13 '11 at 18:15
1 Answers
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
Facebook Birthday Details of friends
Ensure you added required Permission in this Permissions