Android DropBox API 与 DropBox 的链接失败(DBRoulette)

问题描述 投票:0回答:1

当我尝试使用 Android 使用 DBRoulette(来自 Dropbox API 的示例应用程序)访问 Dropbox API 时, 我在模拟器中收到以下两条消息: 然后链接到 Dropbox(我点击它) -不幸的是浏览器已停止。 我从 dropbox 获得了 APP_KEY、SECRET_KEY,我的清单文件是:

<uses-sdk android:minSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application android:icon="@drawable/icon" android:label="@string/app_name">
  <activity
    android:name=".DBRoulette"
    android:label="@string/app_name"
    android:configChanges="orientation|keyboard">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
  </activity>

<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-XXXXXXX" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE"/>
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
</activity>
我的主文件是 DBRoulette,与示例应用程序相同:
com.dropbox.android.sample;
public class DBRoulette extends Activity {
private static final String TAG = "DBRoulette";

///////////////////////////////////////////////////////////////////////////
//                      Your app-specific settings.                      //
///////////////////////////////////////////////////////////////////////////

// Replace this with your app key and secret assigned by Dropbox.
// Note that this is a really insecure way to do this, and you shouldn't
// ship code which contains your key & secret in such an obvious way.
// Obfuscation is good.
final static private String APP_KEY = "xxxxxx";
final static private String APP_SECRET = "xxxx";
....

我使用建议的所有 jar:dropbox-api、http-mime、json-simple 和 android 4.4 作为版本。 为什么我无法访问 Dropbox?是模拟器的原因吗?

java android authentication dropbox dropbox-api
1个回答
0
投票

它不起作用,因为它在模拟器上运行而不是在手机上运行。 在手机上用过,没问题。

© www.soinside.com 2019 - 2024. All rights reserved.