I am integrating twitter in my android app. I am able to authorize the app for the user. Now, I am looking for the API which gives me logged users information like first name, last name, email, etc. I had done this for facebook with
facebook.request("me");
Now how to get user info from twitter? I am using twitter4j-core-android2.2.3.jar. Plz let me know is there a way to get user info.
Finally I got user information.
use the access token you get after
accessToken = twitterConnection.getOAuthAccessToken
(requestToken,editPinCode.getText().toString());
oHelper.storeAccessToken(accessToken);
Log.i("Access Token:", accessToken.getToken());
Log.i("Access Secret:", accessToken.getTokenSecret());
long userID = accessToken.getUserId();
User user = twitterConnection.showUser(userID);
user.getName();
Thanks.
There are a few tutorials here that can help you get an app running with twitter..
if you just need to retrieve info for a specific user, you can look here (includes source code):
Basic Adroid Twitter Integration
If you want to interact with twitter (e.g. post updates etc) then you will need to setup OAuth connection:
Android and Twitter integratin using OAuth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With