I want to post image to twitter on my app. I use "twitter4j" library to post only text. But i cannot find how to post image with text. Thanks for help.
Get KEY and TOKEN from those services and then
/* * Upload File to twitPic and get url . Then append this url to your twitter message. */ public static String upload_twic_pic(File file) throws TwitterException { String url = null; if (file != null) { Configuration conf = new ConfigurationBuilder().setMediaProviderAPIKey(TWITPIC_KEY).build(); ImageUpload upload = new ImageUploadFactory(conf).getInstance(MediaProvider.PLIXI); //Use ImageUploadFactory url = upload.upload(file); } return url;
这是一个文件解决方案的链接,该解决方案确切说明了如何将图片/文本推文集成到android应用中。
You can use socialauth android library
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.