Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
gcstang
9 years agoExplorer | Level 4
Dropbox API v2 session linked ?
How do I migrate this to the v2 Core API?
DropBoxUtils.mDBApi.getSession().isLinked()
I previously had been using dropbox-android-sdk-1.6.3 but I don't see anything that allows me to check this status in the core api v2 for Dropbox.
- The API v2 Java SDK works a little differently than the v1 SDK, so there isn't a direct equivalent. The isLinked method could be called on the Session object to determine if it had an access token, but the v2 SDK doesn't have an equivalent session object.
Instead, you can should just check if you have a DbxClientV2 object. The DbxClientV2 is constructed using the access token in the first place.
You can see how the example app does this here:
https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxClientFactory.java#L26 - That should be a string that identifies your app, generally your app name and app version. You can find more information here under newBuilder:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/DbxRequestConfig.html#newBuilder-java.lang.String-
3 Replies
Replies have been turned off for this discussion
- Greg-DB9 years ago
Dropbox Community Moderator
The API v2 Java SDK works a little differently than the v1 SDK, so there isn't a direct equivalent. The isLinked method could be called on the Session object to determine if it had an access token, but the v2 SDK doesn't have an equivalent session object.
Instead, you can should just check if you have a DbxClientV2 object. The DbxClientV2 is constructed using the access token in the first place.
You can see how the example app does this here:
https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxClientFactory.java#L26 - gcstang9 years agoExplorer | Level 4
In this example, is 'examples-v2-demo' anything specific or just some text?
DbxRequestConfig.newBuilder("examples-v2-demo") - Greg-DB9 years ago
Dropbox Community Moderator
That should be a string that identifies your app, generally your app name and app version. You can find more information here under newBuilder:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/DbxRequestConfig.html#newBuilder-java.lang.String-
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!