This shows the Dropbox API authorization flow and some API calls to retrieve files.
This example is backwards compatible with Android 5.0 (Lollipop). Ensure your build environment supports at least Android SDK version 21.
Running in Android Studio (not strictly necessary)
- Download this
dropbox-sdk-javarepository or clone it usinggit clone https://github.com/dropbox/dropbox-sdk-java. - Open the root folder
dropbox-sdk-javain the terminal, or open it in Android Studio. - Create a
local.propertiesmanually in the Android example project atexamples/android/local.propertieswith the contentDROPBOX_APP_KEY=YOUR_KEY_HEREwhereYOUR_KEY_HEREis your Dropbox App/Api Key.- TIP: You can create this
local.propertiesfile with the appropriate contents by runing this commandecho "DROPBOX_APP_KEY=YOUR_KEY_HERE" > examples/android/local.propertieson the terminal from thedropbox-sdk-java. - NOTE: This step of creating the
examples/android/local.propertiesfile is not required to build the app, but is required if you would like to test authentication.
- TIP: You can create this
- Build and run the Android sample via the Android Studio UI.
This example project uses the source version of dropbox-sdk-java. If you would like to use the published version of the SDK, replace the following in the examples/android/build.gradle file.
- Replace
implementation(project(":core")) - with
implementation("com.dropbox.core:dropbox-core-sdk:LATEST_VERSION_GOES_HERE")