android dropbox sdk,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.

回答1:

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

Unzip the Dropbox Chooser SDK somewhere

Open your project in Android Studio

Create a new sub-directory "libraries" (right-click -> new -> directory)

Create a new module in the libraries directory (right-click -> new -> module)

In the "New Module" window, from "More Modules" select "Android Library"

Click Next

Edit "Library name" to "dropbox-chooser"

Edit module name to "dropbox-chooser"

Edit package name to "com.dropbox.chooser.android"

Click next until done

Navigate to "libraries/dropbox-chooser/src/main"

Delete everything within the "java" and "res" directories, but do not remove the directories

Navigate to the directory where you have unzipped the SDK

Copy everything in the "src" directory to the "java" directory of the new module

Replace the "res" directory in the new module, with the one from the SDK

Do the same with AndroidManifest.xml

Now, to reference the library in your main project:

Open/Create "settings.gradle" in your main project dir

Add include 'libraries:dropbox-chooser' to the file

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.

回答2:

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

来源:https://stackoverflow.com/questions/29104784/how-to-import-dropbox-chooser-sdk-in-android-studio

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值