Android How to get the public tweets with out making user login

411 Views Asked by At

I know this question is asked already . I have read the twitter api. and its Aut but I am so dumb in understanding it. So below is the key point what I want

What I want

  1. I want to get all the tweets going on the basis of hash tag following is the example of what I want on mobile Tweets on #Wwe

  2. I want that my user should not have to sign in his/her twitter account. He just see the list of tweets in my app and get him self updated.

Please tell me which auth do I need ? and How to do all these stuff. And good link with out twitter login please??

1

There are 1 best solutions below

11
On

Steps for Authentication with Twitter Application

1.Create an app on twitter developer account Create Twitter App Get Consumer Key (API Key) Some key value Consumer Secret (API Secret) Some Secret Key Value

2.After getting key you require Bearer Key for Calling Rest Api of Twiiter https://api.twitter.com/oauth2/token Call this url from your android and you will get response as {"token_type":"bearer","access_token":"AAAA%2FAAA%3DAAAAAAAA"}
For more information post/oauth2/token For getting usertimeline tweets json data call this url from android and pass bearer key as header Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%2FAAAAAAAAAAAAAAAAAAAA%3DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

You will get response decode it and display it. For search tweets by hashtag you have to call https://api.twitter.com/1.1/search/tweets.json"+"?q="+URLEncoder.encode("#"+query,"UTF-8")+"&result_type=recent this rest api from android and in header bearer key For detailed Application Only

Your app will be able to, for example:

  1. Pull user timelines;
  2. Access friends and followers of any account;
  3. Access lists resources;
  4. Search in tweets;
  5. Retrieve any user information;

And it won’t be able to:

  1. Post tweets or other resources;
  2. Connect in Streaming endpoints;
  3. Search for users;
  4. Use any geo endpoint;
  5. Access DMs or account credentials;

For more Details Application only twiiter guide