twitter4j-core-3.0.2.jar twitter4j-media-support-3.0.2.jar ライブラリを利用することで、twitter で画像やテストを共有することができます。例
String token = prefs.getString(OAuth.OAUTH_TOKEN, "");
String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, "");
AccessToken a = new AccessToken(token, secret);
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET);
twitter.setOAuthAccessToken(a);
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true).setOAuthConsumerKey(yourConsumerKey).setOAuthConsumerSecret(yourConsumerSeceret).setOAuthAccessToken(yourAccessToken).setOAuthAccessTokenSecret(yourAccessTokenSeceret);
Configuration conf = cb.build();
ImageUploadFactory factory = new ImageUploadFactory(conf);
ImageUpload upload = factory.getInstance();
String url = upload.upload(yourImage, yourCaptionWithImage); //image is a File Format and Caption is String
参考リンク:
1) http://www.londatiga.net/it/how-to-send-image-to-twitpic-from-android/
2) http://www.rqna.net/qna/wupzh-android-image-sharing-on-twitter-using-sdk.html