简体   繁体   中英

Dropbox android sdk documentation

I have been doing some research, and for the life of me, I cannot find any documentation on how to use the android dropbox SDK. I have authenticated the user, but now I cannot figure out how the get the metadata (file entries) of a folder. I have looked at the Web docs, but the arguments in java are turned around, flipped over, and then some.

In objective-c, the methods are straight forward, and I understand what is going on. Must I port the code from objective-c to java?

As far as I can tell as of Sep 20, 2011, Dropbox still hasn't put the Android SDK documentation. Here are some workarounds:

[ EDIT by anotheranon user] My friend stumbled upon this official documentation from Dropbox. Don't even know how he found it. Since this thread is also where I gave up I would like to share!

You should be to find your answer here: https://www.dropbox.com/developers . Looks like the SDK is undocumented.

Try making the calls to the API directly.

In the SDK (DropboxSample), this will list the files in the Public folder of the user account:

In DropboxSample.java add:

public void displayFiles(DropboxAPI.Account account) {
        if (account != null) {
            DropboxAPI.Entry dbe = api.metadata("dropbox", "/Public", 10000, null, true);
            List<Entry> contents = dbe.contents;
            if (contents != null) {
            for (Entry ent:contents) {
                Toast.makeText(this, ent.fileName(), Toast.LENGTH_SHORT).show();
            }
            }
    }
    }

In LoginAsyncTask.java add:

mDropboxSample.displayFiles(mAccount);

below mDropboxSample.displayAccountInfo(mAccount);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM