user1423447
user1423447

Reputation: 53

Upload photo to Dropbox by Android

I am developing an android application to upload photo to dropbox..I can upload photo to facebook and twitter by using facebook sdk and twitter4j but i don't know how to upload photos to dropbox ?

Upvotes: 0

Views: 2561

Answers (3)

thelawnmowerman
thelawnmowerman

Reputation: 12146

The accepted answer is now deprecated (v1 of the library).

Here you can follow an example using the current API. Keep in mind that this API is for Java in general, there is no official SDK for Android. What you have to consider, being Android, is to place all the network-related operations in another thread (apart from the UI thread). Typically, the best way to go is using a Service (since uploading images can take a really long time).

Upvotes: 0

Amel Jose
Amel Jose

Reputation: 883

Here you go..it uploads all kinds of files..

    String outPath = "/mnt/sdcard/" + filename;
    File outFile = new File(outPath);
    FileInputStream fis = new FileInputStream(outFile);
    mRequest = mApi.putFileOverwriteRequest("/"+filename, fis, outFile.length(),null);

mApi is DropboxAPI object.

Upvotes: 2

ariefbayu
ariefbayu

Reputation: 21979

Dropbox developer pages has extensive information.

For Android, you can read the detail, here. And for REST API references. Particularly, the File POST section.

Upvotes: 2

Related Questions