androiddropboxdropbox-apidropbox-sdk

How to remove Dropbox folder access prompt


I have an Android app which uses its own folder on my Dropbox account. Every time I start up my app I get the below prompt:

enter image description here

Is it possible to code my app or configure it somehow so that I only have to acknowledge this prompt just once?

I don't mind having to acknowledge each time I change my code but every time the app is restarted seems a bit excessive.

I've reduced my code right down to one line which causes this to appear:

Auth.startOAuth2Authentication( gContext, APP_KEY );

Solution

  • Turns out I don't need to call:

    Auth.startOAuth2Authentication( gContext, APP_KEY );
    

    Once I get an access token, I can store that for subsequent program restarts and create a DbxClientV2 by using that saved token. I can also generate a token on my app's Dropbox webpage and use that instead (which makes more sense in my case anyway).

    DbxRequestConfig config = new DbxRequestConfig( "dropbox/sample-app" );
    DbxClientV2 client = new DbxClientV2( config, savedToken );
    

    No more auth screen and the API calls continue to work!