Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate Dropbox in android app, but without login popup

I want to use the dropbox in my application.I developed a sample application for upload and download files and it ask for authentication.

But I don't want to open login popup.

Is it possible access the dropbox by other users using default account(single account) login details? So any user can use dropbox directly without login popup.

like image 788
jagdishkumawat Avatar asked Mar 26 '13 11:03

jagdishkumawat


1 Answers

How to set access user access token pair manually.

     AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
     AndroidAuthSession session = new AndroidAuthSession(appKeys, ACCESS_TYPE);
     if (mDBApi == null) {
        mDBApi = new DropboxAPI<AndroidAuthSession>(session);

//  mDBApi.getSession().startAuthentication(Main.this);  //kicks off the web-based authentication
      //you'll have to use the web-based authentication UI one-time to get the ######### values
        String token_key="#########";  
        String token_seceret="#########";
        AccessTokenPair tokens=new AccessTokenPair(token_key,token_seceret);
        mDBApi.getSession().setAccessTokenPair(tokens);     
  //  boolean v=mDBApi.getSession().authenticationSuccessful(); 
    }

First time i run application in debug mode with break point i get the token key and token secret of by entering valid log in detail.and saved(noted) that credential and after that i set them manually as above code then can be log in successfully.

like image 77
jagdishkumawat Avatar answered Oct 05 '22 12:10

jagdishkumawat