Android DropBox API-Link与DropBox失败(DBRoulette)

时间:2014-01-21 10:40:04

标签: java android login dropbox dropbox-api

当我尝试使用DBRoulette访问dropbox API时,来自DropBox API的示例应用程序,使用Android, 我在模拟器中收到以下两条消息: 链接到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";
....

我正在使用所有罐子建议:dropbox-api,http-mime,json-simple和android 4.4作为版本。 为什么我不能访问Dropbox?是因为模拟器?

1 个答案:

答案 0 :(得分:0)

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