I want to fetch information form facebook i know it can be done by using facebook sdk easily but I have a list using intent chooser and from that popup if user click on facebook and they are already logged in, from there I want to fetch user information, form device I want to fetch information.how to do that? EDIT I already get user email id from account manager but i want user name as well how to retrive that?
Edit
AccountManager manager = (AccountManager) getSystemService(ACCOUNT_SERVICE);
Account[] list = manager.getAccounts();
Log.v("tag", "data is "+list);
String possibleEmail="";
try{
possibleEmail += " Gmail Account \n\n";
Account[] accounts = AccountManager.get(this).getAccountsByType("com.google");
for (Account account : accounts) {
possibleEmail += " - "+account.name+" : "+account.type+" , \n";
possibleEmail += " \n\n";
}
}
catch(Exception e)
{
Log.i("Exception", "Exception:"+e) ;
}
try{
possibleEmail += "All Accounts \n\n";
Account[] accounts = AccountManager.get(this).getAccounts();
for (Account account : accounts) {
possibleEmail += " - "+account.name+" : "+account.type+" , \n";
possibleEmail += " \n";
}
}
catch(Exception e)
{
Log.i("Exception", "Exception:"+e) ;
}
// Show on screen
accountsData.setText(possibleEmail);
Log.i("Exception", "mails:"+possibleEmail) ;
}
from this code i am able to get user id of all accounts but it is giving only id's i tried for user name but it's not working with that.any one can help me with this?