【发布时间】:2015-03-01 12:21:04
【问题描述】:
我正在尝试在我的 Android 应用程序中实现 CORE API。
我正在关注 Dropbox 教程。
https://www.dropbox.com/developers/core/start/android
final static private String APP_KEY = "INSERT_APP_KEY";
final static private String APP_SECRET = "INSERT_APP_SECRET";
// In the class declaration section:
private DropboxAPI<AndroidAuthSession> mDBApi;
// And later in some initialization function:
AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
AndroidAuthSession session = new AndroidAuthSession(appKeys);
mDBApi = new DropboxAPI<AndroidAuthSession>(session);
但是,我不知道把这行代码放在哪里?
mDBApi.getSession().startOAuth2Authentication(MyActivity.this);
当我将它放在 Oncreate() 函数中时,我会无限循环地使用 Dropbox 应用程序验证帐户。
谁能给我看一个功能强大的代码示例?
我也想知道如何通过 Dropbox CORE API 从 Dropbox 读取文件?
我应该先下载文件,将其保存到移动内存中,然后像本地文件一样访问它吗?
提前致谢。
【问题讨论】: