Bala
Bala

Reputation: 390

Adding dropbox feature on my android app?

I have found the documentation available at https://www.dropbox.com/developers really not helpful! I even downloaded the sdk available at their site. My project requires the use of dropbox and enable my app to upload images onto a folder in the account. Can anyone help give me relevant info that could be really handy for my project.

thanks in advance.

Upvotes: 2

Views: 1963

Answers (2)

user874649
user874649

Reputation:

        api = getAPI();

        String state = Environment.getExternalStorageState();


        File f=null;
        if (Environment.MEDIA_MOUNTED.equals(state)) 
        {
             //SDcard is available
               f=new File("/sdcard/test.txt");
               if (!f.exists()) 
               {
                //File does not exists
                try {
                    f.createNewFile();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
               }


        }

         api.putFile("dropbox", "/Project", f);

Upvotes: 1

user874649
user874649

Reputation:

Have you tried the Dropbox Android API sample project ? From there, once logged in you can api.putFile("dropbox", "/Project", file); where /Project is the folder in your dropbox account and the file is the file you want to upload. That sample project can be modified to skip gui authentication and do it from code. If you need a full code sample please reply.

Upvotes: 0

Related Questions