Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import dropbox Chooser SDK in Android Studio?

https://www.dropbox.com/developers/dropins/chooser/android

I am trying to use the android chooser in Android Studio but I not sure how to import it to my project and user it. I am using Android Studio, not Eclipse Android Studio if that has any relevance. I just have no idea how to being the unzipped file into use in my project.

like image 920
Killian Mills Avatar asked Mar 17 '15 16:03

Killian Mills


People also ask

How to integrate Dropbox SDK in Android app?

First step of integrating Dropbox SDK in Android app is Authentication Process. For Authenticating and getting App Key and App Secret go to www.dropbox.com/developers/apps and login. Select the Dropbox API app as shown below.

How do I import files from Dropbox to Android app?

Using the Chooser. The Chooser is the fastest way to get files from Dropbox into your Android app. It's a small library that enables your app to access files from Dropbox without having to worry about the complexities of implementing a file browser, OAuth, or managing uploads and storage.

How to add Dropbox-Android-SDK and JSON_simple to Android project?

You are required to download dropbox-android-sdk-1.6.3.jar and json_simple-1.1.jar and place these files in your Libs folder of your android project as shown below. Now add dependency in application gradle file.

Can I use DropBox sync API with Android Studio?

Updated instructions can now be found as part of the standard Sync SDK setup. Yesterday a developer asked on Stack Overflow how he could use the Dropbox Sync API with Android Studio. Although we mention that you can use other tools, we only provide instructions for using the Android Sync API with Eclipse.


2 Answers

It's more complex than it ought to be, but this procedure worked for more than just the Dropbox SDK.

  1. Unzip the Dropbox Chooser SDK somewhere
  2. Open your project in Android Studio
  3. Create a new sub-directory "libraries" (right-click -> new -> directory)
  4. Create a new module in the libraries directory (right-click -> new -> module)
  5. In the "New Module" window, from "More Modules" select "Android Library"
  6. Click Next
  7. Edit "Library name" to "dropbox-chooser"
  8. Edit module name to "dropbox-chooser"
  9. Edit package name to "com.dropbox.chooser.android"
  10. Click next until done
  11. Navigate to "libraries/dropbox-chooser/src/main"
  12. Delete everything within the "java" and "res" directories, but do not remove the directories
  13. Navigate to the directory where you have unzipped the SDK
  14. Copy everything in the "src" directory to the "java" directory of the new module
  15. Replace the "res" directory in the new module, with the one from the SDK
  16. Do the same with AndroidManifest.xml

Now, to reference the library in your main project:

  1. Open/Create "settings.gradle" in your main project dir
  2. Add include 'libraries:dropbox-chooser' to the file
  3. In build.gradle, withing the dependencies section add compile project(':libraries:dropbox-chooser')

This should do the trick. Sync, build, and all should be good.

like image 152
ptashek Avatar answered Sep 30 '22 23:09

ptashek


The Dropbox developers page now includes documentation on how to use the Chooser SDK with Android Studio.

Basically, you create a module from the SDK, and then you add it as a dependency to your project.

Detailed steps are described here: https://www.dropbox.com/developers/dropins/chooser/android

like image 33
Alexandra Feldman Avatar answered Oct 01 '22 00:10

Alexandra Feldman