0

I have Android Studio 1.0.2 and I'm trying to use the Dropbox API, but I'm unable to reference a project DropboxChooserSDK.

Their instructions refer to Eclipse not Android Studio and the other answers here don't go upto 1.0.2.

So how would Android Studio allow you to reference a project?

user94628
  • 3,641
  • 17
  • 51
  • 88
  • I am not able to open the url. If it is library project, download and in android studio create a new module to import the library. Refer this S O - http://stackoverflow.com/questions/18904814/cant-add-modules-on-project-structure-in-android-studio – droid kid Feb 04 '15 at 13:04

1 Answers1

0

Need to set the “dependencies” to Dropbox API with Gradle.

The instruction below are for setting dependencies with the Android Studio GUI. I not exactly sure about the Dropbox API, never used it. I tried the instruction with other libraries, JAR and it seems to work OK.

TRY:

With in the Project needing to use Dropbox API.

Android Studio Main Menu - > File - > Project Structure.

Select within the panel on the Left Hand Side the folder where the API will be used. That NEEDS to have access to the Dropbox API.

Select the Tab marked “Dependencies”.

Within the “Dependencies” tab.

One the Top Right Hand side Select the Green Plus Sign.

Pick one of:

1 Library dependency. 2 File dependency. 3 Module dependency.

As An Aside. Sometimes I had to try more than one of the above to get it to work.

A dialog box pops up

Set the path to the location of the DropBox API.

OK, Gives a a dialog that select the DropBox API.

Click "Apply"

Click "OK"

Gradle sync should run.

Once the “Dependencies” AND gradlle Sync gives “BUILD SUCCESSFUL”.

You Should be able to access the DropBox API within your project.

Android Studio should handle all the import stuff in the header of the Java class file where you need to use the DropBox API.

Just put in the name of one of the class defined in the DropBox API in you project.

when Android Studio underlines that class in red, put you mouse on the red under line in the class file.

ALT ENTER and pick import class:

Hope that helps you sort out getting the DropBox API in to your project.

Mark_97

mark_97
  • 307
  • 1
  • 4
  • 13