在Android应用程序中集成Dropbox,但没有登录弹出窗口

jag*_*wat 11 android dropbox dropbox-api

我想在我的应用程序中使用dropbox.我开发了一个上传和下载文件的示例应用程序,并要求进行身份验证.

但我不想打开登录弹出窗口.

是否可以使用默认帐户(单个帐户)登录详细信息访问其他用户的Dropbox?因此任何用户都可以直接使用dropbox而无需登录弹出窗口.

jag*_*wat 7

如何手动设置访问用户访问令牌对.

     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(); 
    }
Run Code Online (Sandbox Code Playgroud)

我第一次在调试模式下使用断点运行应用程序我通过输入有效的详细日志来获取令牌密钥和令牌秘密.并保存(注明)该凭证,然后我手动设置它们如上面的代码然后可以成功登录.