Android twitter image uploading?


#1

In my app i want to upload image via twitter api ? and i have image Url For image…It’s possibe ??


#2

You can upload images to Tweets by using the statuses/update_with_media endpoint: https://dev.twitter.com/docs/api/1/post/statuses/update_with_media


#3

En kasa Tengo una Energia de Madre taachoo brodeeerr


#4

In My app, I want to upload image in twitter wall using android? please given sample project


#5

TwitterSession twitterSession = new TwitterSession(SendImageActivity.this);
AccessToken accessToken = twitterSession.getAccessToken();

		Configuration conf = new ConfigurationBuilder()                 
        .setOAuthConsumerKey(twitter_consumer_key) 
        .setOAuthConsumerSecret(twitter_secret_key) 
        .setOAuthAccessToken(accessToken.getToken()) 
        .setOAuthAccessTokenSecret(accessToken.getTokenSecret()) 
        .build(); 
		
		OAuthAuthorization auth = new OAuthAuthorization (conf);
        
        ImageUpload upload = ImageUpload.getTwitpicUploader (twitpic_api_key, auth);
        
        Log.d(TAG, "Start sending image...");
        
        try {
        	url = upload.upload(new File(mPath));
        	result = 1;
        	
        	Log.d(TAG, "Image uploaded, Twitpic url is " + url);	        
        } catch (Exception e) {		   
        	Log.e(TAG, "Failed to send image");
        	
        	e.printStackTrace();
        }
        
        return result;
    }

#6

suppose my image url is
String path= “http://tineye.com/images/widgets/mona.jpg

url = upload.upload(new File(path));

When i use like this then failed to upload error message display.

Can anybody have idea that how can I give my image url to above code?


#7

i use twitter4j api to post image to twitter, initially my project worked without any exception but after further development it became unresponsive. Below is the error log form eclipse logcat.

com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate:
current time: Fri May 10 12:37:38 IST 2013, expiration time: Fri May 10 05:29:59 IST 2013
TwitterException{exceptionCode=[f69e96cd-138ff489 f69e96cd-138ff438 f69e96cd-138ff438 f69e96cd-138ff438 f69e96cd-138ff438], statusCode=-1, retryAfter=0, rateLimitStatus=null, version=2.1.6}

This happened since last night and I cant figure out whether this is due to twitter server error or not.

i want quick reply, very urgent


#8

I have twitter4j-core-3.0.3 in my library but it seems that the filetype ImageUpload is unresolved. I don’t know what library ImageUpload is from. Here is a screenshot: http://prntscr.com/16eidr

EDIT: I didn’t know that we should include another import: twitter4j-media-support


#9

In my application I got success message when i post tweet but i didnot get tweet in my account please any one reply me


#10

I am getting the problem that using twitter4j i m unable to upload the image of size more thank 50kb


#11

where I could get the twitpic_api_key? thank you:)


#12

see http://stackoverflow.com/a/15830579