twitter image upload (twitpic api)- unable find image upload method

579 Views Asked by At

I am new to android development. I need to post text and image in twitter through my Android application.

I got one sample project AndroidTwitpic. I had problem in connection. Later I replaced twitter4j-core-2.1.6.jar library with twitter4j-core-3.0.3.jar library. Now the connection to Twitter is working fine but am getting error like:

ImageUpload cannot be resolved to a type.

Is there any library required to add? What is the mistake I have done?

3

There are 3 best solutions below

0
On

See this tutorail its very helpful Twitt pic with text

1
On

You need to add other libraries:

signpost-commonshttp4-1.2.1.1.jar
signpost-core-1.2.1.1.jar
signpost-jetty6-1.2.1.1.jar
0
On

Not entirely sure how things were placed prior to the Twitter4J 3.0.2 (I wasn't working on it then). However, somewhere in between versions, they seem to have changed the library (speculation on my part).

For uploading Media of any kind, you need an additional library called twitter4j-media-support-3.0.3.jar. You can download it here:

http://grepcode.com/snapshot/repo1.maven.org/maven2/org.twitter4j/twitter4j-media-support/3.0.3 (Choose the Binary download option on the page).

Alternative Links:

  1. http://mvnrepository.com/artifact/org.twitter4j/twitter4j-core/3.0.3
  2. http://www.java2s.com/Code/Jar/t/Downloadtwitter4jmediasupportjar.htm (Make sure you search for the latest version. It has a long list of earlier versions too)
  3. http://twitter4j.org/maven2/org/twitter4j/twitter4j-media-support/3.0.3/