get already loggedin user information form facebook in android -
I want to fetch information form facebook I know that this can be easily done using Facebook SDK but I have a list that uses the intended choice and if the user clicks on Facebook and they are already logged in from that popup, then from there I want to bring the user's information, form device, to bring information Want to Am. to do this? Edit I have already received the User Email ID from the Account Manager but how do I want to correct the user's name?
Edit
Account Manager Manager = (Account Manager) getSystemService (ACCOUNT_SERVICE); Account [] list = manager.getAccounts (); Logs. V ("tag", "data is" + list); Possible string email = ""; Try {possibleEmail + = "Gmail account \ n \ n"; Account [] accounts = account-manager.get (this) .etxchangebytip ("com.google"); (Account account: accounts) {possibleEmail + = "-" + account.name + ":" + account.type + ", \ n"; PossibleEmail + = "\ n \ n"; }} Hold (exception e) {Log.i ("exception", "exception:" + E); } {E-mail E = "Try All Accounts \ n \ n"; Account [] accounts = account manager .get (this) .getAccounts (); (Account account: accounts) {possibleEmail + = "-" + account.name + ":" + account.type + ", \ n"; Possible email + = "\ n"; }} Hold (exception e) {Log.i ("exception", "exception:" + E); } // Displayed on the Screen AccountDetatetText (potential e-mail); Log.i ("exception", "mail:" + possible e-mail); }
With this code, I am able to get the User ID of all the accounts but it is only trying to give the name of the user ID, but it is not working with it. . Can anyone help me on this?
According to my understanding you can get two functionality in this way.
For Twitter, you should use twitter4j-core-android2.2.3.jar and here is the code snippet to get user information
accesstooken = twitterConnection.getOAuthAccessToken (RequestToken, editPinCode.getText (). Wire ()); OHelper.storeAccessToken (accessToken); Log.i ("Access token:", accessToken.getToken ()); Logs. I ("Access Secret:", accessToken.getTokenSecret ()); Tall User ID = AccessToken.GetUserID (); User user = twitterConnection.showUser (userID); User.getName ();
and for gplus integration & amp; Implementation just follow this tutorial
The code snippet is here
Plus.POPALAPI.Test users to request profile information Currently signed in the user.
After connecting to GoogleApiClient, you can call the getCurrentPerson method:
@OrrideConnected at public zero () {... if (Plus.PeopleApi.getCurrentPerson (MGoogleApiClient)! = Null) {person current Person = Plus.PeopleApi.getCurrentPerson (mGoogleApiClient); String Person Name = Current Person.getDisplayName (); String Person Photo = Current Person.getImage (); String Person GooglePlusProfile = Current Person.getUrl (); }}
Comments
Post a Comment