This is sample app for Twitter Client application using #Twitter SDK #MVP
Generate your Twitter API keys through the Twitter developer apps dashboard. Install Twitter Kit using instructions below.
repositories {
jcenter()
}
dependencies {
implementation 'com.twitter.sdk.android:twitter:3.1.1'
implementation 'com.twitter.sdk.android:twitter-core:3.1.1'
}
}
Below are the highlights for sample.
-
App using Android Architecture Patterns Model-View-Presenter
-
Login: Connect with twitter using API Keys
-
On Login success make request for 10 tweets in his/her feed (you can use UserTimeline, SearchTimeline, FixedTweetTimeline etc..)
-
Display specific tweet details from recycleview tweets item using passing twitterID screen: author, number of likes and retweets, date
-
Pull to refresh for update the new data
-
Cache the data using java file using gson which can be used for offline.
-
Display profile image, number of tweets, how many followers and following.
-
Compose new tweets using internal api from Twitter SDK exmpale
final TwitterSession session = TwitterCore.getInstance().getSessionManager()
.getActiveSession();
final Intent intent = new ComposerActivity.Builder(DashBoardActivity.this)
.session(session)
.text("Love where you work")
.hashtags("#twitter")
.createIntent();
startActivity(intent);
Use callback url as twittersdk:// on app.twitter.com settings
Form app side add app key on string resorunce file
<string name="com.twitter.sdk.android.CONSUMER_KEY">consumer key</string>
<string name="com.twitter.sdk.android.CONSUMER_SECRET"consumer secret</string>