Sunday 15 March 2015

android - How to get tweets using Twitter4J without credentials? -


I am using an example on this to search on Twitter.

This is my code:

  increases the main activity activity of the public class {@ override protected minus the creation (bundle saved instenstate) {super.onCreate (savedInstanceState) ; SetContentView (R.layout.activity_main); SearchTweets (); } Private Zero SearchTits () {Twitter Twitter = New TwitterFiner () GetInstance (); {Try query query = new query ("Android"); Query result result; Doing {Results = Twitter Search (query); & Lt; Status & gt; Tweets = Results .getTweets (); (For status tweets: Tweets) {System.out.println ("@" + tweet .Gate User (). GetScreenName () + "-" + + .chich tag ()); }} While {(query = result.nextQuery ())! = Null; System.exit (0);} hold (twitterexception te) {te.printStackTrace (); System.out.println ("Failed to find Tweets:" + Te.getMessage ();; System.exit (-1); I am experiencing this error message:  
  unable   

I Using twitter4j-core-3.0.3

Start activity {... MainActivity}: java.lang.IllegalStateException: authentication credentials are unavailable for details http://twitter4j.org/configuration See .html.

But, tweet me a few to get the tweets Why do I have to set up credentials?

Is there anything wrong with my code?

Thanks since API 1.1, authentication is required, as it says:

In Version 1.1, we need to provide all of the applications with OAuth 1.0a or only application-only authentication Requests are required to authenticate the requests. Not only this visibility will allow us to stop abusive behavior, but it will give us It will also help in understanding how to use the API. We will implement this understanding to meet the needs of developers better because we continue to develop the platform. At this time, user authentication is required for all authentication, but in the coming weeks we will exclude support for authentication that does not require user references.

No comments:

Post a Comment