I have seen this answer for the same type of question. when i am using the code its always throwing an Twitter Exception
.I am calling it like upload_twic_pic(new File("my_image_path"));
and getting following Exception
W/System.err(2195): Connection reset by peerRelevant discussions can be on the Internet at:
W/System.err(2195): http://www.google.co.jp/search?q=ea09dc6d or
W/System.err(2195): http://www.google.co.jp/search?q=050d9b43
W/System.err(2195): TwitterException{exceptionCode=[ea09dc6d-050d9b43 0237e8c8-9ca5c8e4], statusCode=-1, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.3}
W/System.err(2195): at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:204)
Found the answer here which is working like charm. just had to copy and past the code provided in answer and was using old jar file i replaced that with the latest one as instructed in the answer.