Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7944069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:27:09+00:00 2026-06-04T00:27:09+00:00

Possible Duplicate: Can we post image on twitter using twitter API in Android? I

  • 0

Possible Duplicate:
Can we post image on twitter using twitter API in Android?

I am working in an android application and I want to tweet a message and a picture to twitter. I am able to tweet only tweets to twitter by the code :

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);
try {

**twitter.updateStatus("New tweet");**
        twitter.//Which property of twitter should I use to tweet an image and  //message
} catch (TwitterException e) {
    // TODO Auto-generated catch block
    Log.e("Errorssssssssssssss", e.toString());
}

How do I include an image as well?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:27:10+00:00Added an answer on June 4, 2026 at 12:27 am

    refer to http://www.londatiga.net/it/how-to-post-twitter-status-from-android/, use twitter4j library

    public void uploadPic(File file, String message) throws Exception  {
        try{
        StatusUpdate status = new StatusUpdate(message);
        status.setMedia(file);
        mTwitter.updateStatus(status);}
        catch(TwitterException e){
            Log.d("TAG", "Pic Upload error" + e.getErrorMessage());
            throw e;
        }
    }
    

    where mTwitter is an instance of Twitter class

    Make sure you are using latest version of twitter4j-core jar file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Force Download an Image Using Javascript Basically I want to have the
Possible Duplicate: android steganography Has anyone implemented steganography on android? Can anyone post sample
Possible Duplicate: twitter integration on android app Hi all, how to post the tweets
Possible Duplicate: Is there an iPhone SDK API for twitter? i need to post
Possible Duplicate: Can I write native iPhone apps using Python this post Can I
Possible Duplicate: Can't get Twitter OAuth callback authentication to work in Cocoa application I
Possible Duplicate: Can anybody suggest the best image resize script in php? I'm still
Possible Duplicate: How can I pre-set arguments in JavaScript function call? (Partial Function Application)
Possible Duplicate: submit a form using jquery Hello friends How can I submit a
Possible Duplicate: Facebook Connect error: can't post to wall in iPhone I had a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.