简体   繁体   中英

Android app check for user Dropbox accounts on device

I am developing an app to download all the images from Dropbox. I am using Dropbox Core API and have followed this example: Android Dropbox Core API official documentation

I would like to check if there are an account already opened on the device. In this case I want to get this session, otherwise I will build a new session with the Dropbox Core API . Is it that possible?

Thanks!

As noted in the tutorial you linked to, when using the Android Dropbox Core API, you can and should store and re-use the resulting access token for a user after they first authorize the app. (This is typically done using SharedPreferences .)

On later runs of your app, your app should check wherever it stored the token to see if it has one. If it does, it can try to use that.

If you do have an access token, you can construct an AndroidAuthSession , eg, using this constructor:

https://www.dropboxstatic.com/static/developers/dropbox-android-sdk-1.6.3-docs/com/dropbox/client2/android/AndroidAuthSession.html#AndroidAuthSession(com.dropbox.client2.session.AppKeyPair,%20java.lang.String)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM