Posting Image on twitter using android app



How to upload server image on twitter through android app using fabric api.


I wants to upload my server image, by using url that is pointing to my server image like -

I try to use :slight_smile:

Uri uri=Uri.parse(url);

TweetComposer.Builder builder = new TweetComposer.Builder(ComplainActivity.this)

but only text is post on twitter but not image.


Hey @sushil_dhamal,

TwitterKit will help you do that.

If your users have Twitter App installed in their Android phones, you can use Android intents to open Twitter app to compose a tweet and supply the URI of the image.
You’ll have to have this image locally available, to supply to the composers.

Alternatively, you can also use the TwitterKit TweetComposer to present an in-app Tweet Composer with images attached, so that the user can tweet without going outside of your app.

Make sure the user is logged in before using TweetComposer.
Logging the user in will also be facilitated by TwitterKit.

This documentation details about how to compose a tweet with above two methods :

And this documentation explains how to have users log in with Twitter :

All the best!

Play video android?

hey @AmanAlam,

Thanks for your response. The issue is I have developed an APP through which a user can share his post either on Facebook or Twitter. In some cases the user might have a PIC associated to the content.

In that case both the content and pic should be shared on twitter. Please note that image we are storing at server which needs to be posted.


Hey @sushil_dhamal ,

If you want to upload the image as a native media to the tweet, you’ll have to have the image in local storage and supply it’s URI.
You may want to download and save your image from the server URL, before doing this.

If you’d choose to rather put a url to the image to the tweet, you can put the URL in the tweet body, but in this case the image will not be attached with the tweet as a native media.


Hey, @AmanAlam,

Thanks for giving me a valueable response.