I just had a chance to work on a similar issue. Let me help with your questions first.
Does Authentication Required means - the end user using my app should
have a twitter account to get these tweets?
No. The end user need not have to sign into his Twitter account to see public feeds. But, you will have to use the consumer key and secret key for the app that you have created in the Twitter developers website.
Do I need some tokens to pass with the request? How to get those?
As I have explained to the previous question, you need to make use of consumer key, consumer secret, access token and access secret.
Here is a little example which I worked on to get public feeds. The below sample will fetch latest 20 public feeds of the user.
Before that you need to import the latest twitter library into your project which is twitter4j 3.0.3 as of now.
And then add the below given code to your project and should be done.
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey("B***************Q")
.setOAuthConsumerSecret(
"l*********************************o")
.setOAuthAccessToken(
"1*******************************X")
.setOAuthAccessTokenSecret(
"1***************************c");
TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
try {
List<Status> statuses;
String user;
user = "replace with the user name of your choice";
statuses = twitter.getUserTimeline(user);
Log.i("Status Count", statuses.size() + " Feeds");
for (int i = 0; i < statuses.size(); i++) {
Status status = statuses.get(i);
Log.i("Tweet Count " + (i + 1), status.getText() + "\n\n");
}
} catch (TwitterException te) {
te.printStackTrace();
}