Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
hi all,
Currently I am developing an Android App with Android Studio and I got Dropbox API to get information from Dropbox. I am blocked with a method to get information from Dopbox account (.txt, .html, .jpg whatever file is displayed there) and display it on the screen of the simulator without download that file in any folder (reading directly from Dropbox). I am new with the API, could anyone share with me an example code to archieve it? or send me any information about that.
Thank you.
To use the Dropbox API from an Android app, we recommend using the official Dropbox API v2 Java SDK.
With that, you can use the download or downloadBuilder methods to access file data from the connected Dropbox account.
There's an example of calling the download method in an Android app here.
While that example happens to save the file to the local filesystem, you are not required to do so. You can use the returned DbxDownloader to write to an OutputStream, using DbxDownloader.download, or get an InputStream of the file content, using DbxDownloader.getInputStream, and then use that InputStream however you wish.
I didn´t get it! Can please anyone help me out?
I am new on Android Studio, I need to know hoy to make the call from the On Create method, or life circle of the call.
Thanks!
@cris3c Did you see my comment from earlier? Please refer to the links there for a number of useful resources.
If something isn't working as expected, or you're stuck on something, perhaps you could share what you have so far and what problem you're currently seeing.
Hi,
I have cloned the example code in my local and opened it with Android Studio. Reading your tutorial in the following link: https://github.com/dropbox/dropbox-sdk-java#authorize
I started to follow the steps to build from source and run the examples, I could not pass the first step. It said that: "Follow the instructions in the "Build from source" section above." and that means that you have to run gradlew build code but when I run that it does not work due to next error:
Could you help me out, please? Am I following the steps properly?
Thank you.
Technically you don't need to build from source if you don't need to change the source code for the SDK (which you probably don't have reason to do). Instead, it's much easier to just install a released version. For example, you can replace this line from the Android example build.gradle:
implementation group: 'com.dropbox.core', name: 'dropbox-core-sdk', version: '0-SNAPSHOT', changing: true
With this instead:
implementation 'com.dropbox.core:dropbox-core-sdk:3.1.5'
Then once you do a Gradle sync for that change in Android Studio, it will download and install it for you.
Hi,
The code lines you told me work perfectly but I found another error. I think android studio does not find the executable run.exe. I attach the following terminal message. It is in spanish but it can be read easily.
Could you help me out, please?
I see you're now attempting to run the "authorize" example, and are trying to do so via a "run" command. That's actually referring to this "run" file which is a bash script, so you'd need to be running in an environment that can run bash scripts (such as cygwin).
If you're just trying to build an Android app though, I recommend just referring to the Android example app. The "authorize" example is just a command line app.
Hi, I was trying to run the example in an environment that does not support bash scripts. So as you said, I built the android example, but when I try to run it this error comes:
I think the error is in the packages. Could you please help me out?
This appears to indicate that the Dropbox library wasn't successfully loaded. Were you able to add it as instructed in my earlier comment? Did the Gradle sync complete successfully after that?
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!