Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9160579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:46:20+00:00 2026-06-17T13:46:20+00:00

I’m new in Android dev and I’m developing an Android App using Eclipse. I

  • 0

I’m new in Android dev and I’m developing an Android App using Eclipse. I provided a functionality to Synchronize database on Dropbox. To do it, Dropbox give me a key value to use for authentication. This key have to be inserted in AndroidManifest.xml

<activity
android:name="com.dropbox.client2.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask" >
<intent-filter>
    <!-- Change this to be db- followed by your app key -->
    <data android:scheme="db-xxxxxxxxxx" />

    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

But using this logic, the end user will not be able to change this value to synchronize database on his dropbox account, and not on my. I’ve made a preference screen to store the key in Application Preferences, but I’ don’t find code where the value is read from Android Manifest. I think it’s about here but I’m new and I don’t understand how to edit my code:

 public void startAuthentication(Context context) {
    AppKeyPair appKeyPair = getAppKeyPair();

    // Check if the app has set up its manifest properly.
    Intent testIntent = new Intent(Intent.ACTION_VIEW);
    String scheme = "db-" + appKeyPair.key;
    String uri = scheme + "://" + AuthActivity.AUTH_VERSION + "/test";
    testIntent.setData(Uri.parse(uri));
    PackageManager pm = context.getPackageManager();
    List<ResolveInfo> activities = pm.queryIntentActivities(testIntent, 0);

    if (0 == activities.size()) {
        throw new IllegalStateException("URI scheme in your app's " +
                "manifest is not set up correctly. You should have a " +
                "com.dropbox.client2.android.AuthActivity with the " +
                "scheme: " + scheme);
    } else if (activities.size() > 1) {
        // Check to make sure there's no other app with this scheme.
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle("Security alert");
        builder.setMessage("Another app on your phone may be trying to " +
                "pose as the app you are currently using. The malicious " +
                "app cannot access your account, but linking to Dropbox " +
                "has been disabled as a precaution. Please contact " +
                "support@dropbox.com.");
        builder.setPositiveButton("OK", new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        builder.show();
        return;
    } else {
        // Just one activity registered for the URI scheme. Now make sure
        // it's within the same package so when we return from web auth
        // we're going back to this app and not some other app.
        String authPackage = activities.get(0).activityInfo.packageName;
        if (!context.getPackageName().equals(authPackage)) {
            throw new IllegalStateException("There must be an " +
                    "AuthActivity within your app's package registered " +
                    "for your URI scheme (" + scheme + "). However, it " +
                    "appears that an activity in a different package is " +
                    "registered for that scheme instead. If you have " +
                    "multiple apps that all want to use the same access" +
                    "token pair, designate one of them to do " +
                    "authentication and have the other apps launch it " +
                    "and then retrieve the token pair from it.");
        }
    }

    // Start Dropbox auth activity.
    Intent intent = new Intent(context, AuthActivity.class);
    intent.putExtra(AuthActivity.EXTRA_INTERNAL_CONSUMER_KEY,
            appKeyPair.key);
    intent.putExtra(AuthActivity.EXTRA_INTERNAL_CONSUMER_SECRET,
            appKeyPair.secret);
    if (!(context instanceof Activity)) {
        // If starting the intent outside of an Activity, must include
        // this. See startActivity(). Otherwise, we prefer to stay in
        // the same task.
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    context.startActivity(intent);

Can you help me?

Thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:46:21+00:00Added an answer on June 17, 2026 at 1:46 pm

    I think that you may be misunderstanding what that key is used for. It is not used for choosing which account to sync files with.

    The key you want to change is an APP API key. Each user does not need a unique key unless you are targeting at developers who would have their own API keys already. This is used to identify your app and shut it down, among other things, if it’s causing trouble for Dropbox.

    The specific instance of this key you are trying to edit is what gets control back to your app after a user authenticates with their personal account. This needs to be kept in sync with the key you use for authentication when calling AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);

    You will not be able to modify the the data tag in that intent filter at runtime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I want use html5's new tag to play a wav file (currently only supported
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.