Android开发:集成dropbox网盘功能

来源:互联网 发布:入门单反推荐2017知乎 编辑:程序博客网 时间:2024/04/19 16:06


我现在要记一下,我的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;
1 0
原创粉丝点击