Uploading Images to tumblr API from Android Uploading Images to tumblr API from Android android android

Uploading Images to tumblr API from Android


Why don't you use Jumblr the official Java client for Tumblr.

Regards.


You can easily do this using jumblr - Tumblr java client

JumblrClient client = new JumblrClient(Constant.CONSUMER_KEY,Constant.CONSUMER_SECRET);client.setToken(preferences.getString("token",null), preferences.getString("token_secret", null));PhotoPost pp = client.newPost(client.user().getBlogs().get(0).getName(),PhotoPost.class);pp.setCaption(caption);// pp.setLinkUrl(link);// pp.setSource(mImage); // String URLpp.setPhoto(new Photo(imgFile));pp.save();


This worked for me...

nameValuePairs.add(new BasicNameValuePair(URLEncoder                .encode("type", "UTF-8"),                     URLEncoder.encode("photo", "UTF-8")));Log.e("Tumblr", "Image shareing file path" + filePath);nameValuePairs.add(new BasicNameValuePair("caption", caption));nameValuePairs.add(new BasicNameValuePair("source", filePath));`

where filePath is http url.