cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Copying files FROM Dropbox to my Android app

Copying files FROM Dropbox to my Android app

willbu1971
New member | Level 2
Go to solution

Hi all. I'm new to the DropBox SDK so please forgive if I ask a question that has been asked many times. I did do a search on the site but could not find anything like what I'm attempting to do.

 

I want to store a directory of photos (PNGs) on a DropBox folder. I'm writing an Android app using Android Studio (Gradle) that contains an activity that will be a photo gallery. When the activity loads, I want the app to connect to the DropBox folder and copy the files to the app's 'drawable' folder. The app will then build the photo gallery on the fly based on those photos. The SDK for Java seems to be somewhat out of date as the sample code for connecting to DropBox contains a method that is deprecated.

 

I've written the code to ennumerate through the drawable folder and build the photo gallery. All I need is an example of where you use Java to connect to a folder in DropBox and copies (transfers) the files in that folder to the app. Or even more simply, if I could see an example where you use Java to connect to the DropBox folder and make a list of the files in that folder - that would work. I can probably figure out how to copy the files to the app myself.

 

Thanks in advance for your time and assistance!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
Where exactly is the deprecated method usage that you're referring to? I'll ask the team to update that.

Anyway, there's a sample of listing items in a folder here:

https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/a...

And there's a sample of downloading files here:

https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/a...

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution
Where exactly is the deprecated method usage that you're referring to? I'll ask the team to update that.

Anyway, there's a sample of listing items in a folder here:

https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/a...

And there's a sample of downloading files here:

https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/a...

willbu1971
New member | Level 2
Go to solution

The page at https://www.dropbox.com/developers/documentation/java links to Github. On that page (https://github.com/dropbox/dropbox-sdk-java) in the 'Link an account' section you see the code example given for the version 2 API. Specifically, the main method contains this line:

DbxRequestConfig config = new DbxRequestConfig("dropbox/java-tutorial", "en_US");

 

In Android Studio, DbxRequestConfig is flagged as deprecated.

 

Someone also posted about this issue on Stack Overflow (https://stackoverflow.com/questions/47302711/dbxrequestconfig-is-deprecated-in-api-v2)

 

Thanks for linking the examples!

Greg-DB
Dropbox Staff
Go to solution
Thanks! I'll ask the team to update that accordingly.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    willbu1971 New member | Level 2
What do Dropbox user levels mean?