I am implementing twitter kit for android in my application following the official documentation (https://github.com/twitter/twitter-kit-android/wiki). I make the login and I get the basic data correctly and without problem.
When I want to get the user's tweets, or time line, the way to do it is indicated but always shown in a list or recyclerview (https://github.com/twitter/twitter-kit-android/wiki/Show-Timelines)
I have seen these examples also in stackoverflow where the same solution is given, but always turning the data into a list or recyclerview
My question: is there any way to get just the JSON response to the query, ?
The answers I have found do not specifically respond to this.
In the following way it is possible to obtain a list of tweets, but I can not apply search filters like the date, or keywords (untilDate, etc)
void writeInFile()
{
userTimeline = new UserTimeline.Builder()
.userId(userID)
.includeRetweets(false)
.maxItemsPerRequest(200)
.build();
userTimeline.next(null, callback);
}
Callback<TimelineResult<Tweet>> callback = new Callback<TimelineResult<Tweet>>()
{
@Override
public void success(Result<TimelineResult<Tweet>> searchResult)
{
List<Tweet> tweets = searchResult.data.items;
for (Tweet tweet : tweets)
{
String str = tweet.text; //Here is the body
maxId = tweet.id;
Log.v(TAG,str);
}
if (searchResult.data.items.size() == 100) {
userTimeline.previous(maxId, callback);
}
else {
}
}
@Override
public void failure(TwitterException error)
{
Log.e(TAG,"Error");
}
};