Android开发:集成dropbox网盘功能


我现在要记一下,我的DropBox创建应用来下载和上传手机本地的文件和图片


1,打开dropbox 官网 

        https://www.dropbox.com/developers,选择 my apps,然后点击右侧create an App,然后你可以要验证您的邮箱,输入APP name (最好和应用程序名称相同),Description(说明,可以不填写),Access level 选择需要模式就好,









App folder - Your app only needs access to a single folder within the user's Dropbox (recommended).

Full Dropbox - Your app needs access to the user's entire Dropbox.(此模式需要dropbox官方审查)。
刚刚申请的应用是开发状态,如果应用开发完成,点击Apply for production status 进行操作。


2,下面点击 Getting started ,进行API的一个大致了解。

      点击Core concepts ,选择android,

3,安装环境,测试例子

    1,下载,https://www.dropbox.com/developers/reference/sdk ,下载android SDK,

    2,然后eclipse导入dropbox-android-sdk-1.2.1\examples\DBRoulette

    3,修改 AndroidManifest.xml ,增加以下内容

<activity android:name="com.dropbox.client2.android.AuthActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboard"> <intent-filter> <!-- Change this to be db- followed by your app key --> <data android:scheme="db-INSERT-APP-KEY-HERE" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
 <!-- 在application标签后增加-->
  <uses-permission android:name="android.permission.INTERNET" />   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
4,搜索并修改所有CHANG_ME为创建应用,生成的应用App keyApp secret.在sdk自带列子代码中有注释
5,修改ACCESS_TYPE 为应用申请的模式,AccessType.DROPBOX;AccessType.APP_FOLDER;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值