We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
cris3c
6 years agoExplorer | Level 4
Reading content from a file and show it WITHOUT downloading
hi all,
Currently I am developing an Android App with Android Studio and I got Dropbox API to get information from Dropbox. I am blocked with a method to get information from Dopbox account (.t...
Greg-DB
Dropbox Community Moderator
6 years agoI see you're now attempting to run the "authorize" example, and are trying to do so via a "run" command. That's actually referring to this "run" file which is a bash script, so you'd need to be running in an environment that can run bash scripts (such as cygwin).
If you're just trying to build an Android app though, I recommend just referring to the Android example app. The "authorize" example is just a command line app.
cris3c
6 years agoExplorer | Level 4
Hi, I was trying to run the example in an environment that does not support bash scripts. So as you said, I built the android example, but when I try to run it this error comes:
- API 'variant.getMappingFile()' is obsolete and has been replaced with 'variant.getMappingFileProvider()'.
- API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
- src/main/java/com/dropbox/core/examples/android/DownloadFileTask.java
- package com.dropbox.core.v2.files does not exist
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot access DbxClientV2Base class file for com.dropbox.core.v2.DbxClientV2Base not found
- src/main/java/com/dropbox/core/examples/android/FilesActivity.java
- package com.dropbox.core.v2.files does not exist
- package com.dropbox.core.v2.files does not exist
- package com.dropbox.core.v2.files does not exist
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FolderMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class ListFolderResult
- cannot find symbol class FileMetadata
- uses or overrides a deprecated API.
- src/main/java/com/dropbox/core/examples/android/FilesAdapter.java
- package com.dropbox.core.v2.files does not exist
- package com.dropbox.core.v2.files does not exist
- package com.dropbox.core.v2.files does not exist
- cannot find symbol class Metadata
- cannot find symbol class Metadata
- cannot find symbol class Metadata
- cannot find symbol class Metadata
- cannot find symbol class FolderMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FolderMetadata
- cannot find symbol class FolderMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FolderMetadata
- src/main/java/com/dropbox/core/examples/android/FileThumbnailRequestHandler.java
- package com.dropbox.core.v2.files does not exist
- package com.dropbox.core.v2.files does not exist
- package com.dropbox.core.v2.files does not exist
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol variable ThumbnailSize
- cannot find symbol variable ThumbnailFormat
- cannot find symbol method files()
- src/main/java/com/dropbox/core/examples/android/GetCurrentAccountTask.java
- package com.dropbox.core.v2.users does not exist
- cannot find symbol class FullAccount
- cannot find symbol class FullAccount
- cannot find symbol class FullAccount
- cannot find symbol class FullAccount
- cannot find symbol method users()
- src/main/java/com/dropbox/core/examples/android/ListFolderTask.java
- package com.dropbox.core.v2.files does not exist
- cannot find symbol class ListFolderResult
- cannot find symbol class ListFolderResult
- cannot find symbol class ListFolderResult
- cannot find symbol class ListFolderResult
- cannot find symbol method files()
- src/main/java/com/dropbox/core/examples/android/UploadFileTask.java
- package com.dropbox.core.v2.files does not exist
- package com.dropbox.core.v2.files does not exist
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol class FileMetadata
- cannot find symbol variable WriteMode
- cannot find symbol method files()
- src/main/java/com/dropbox/core/examples/android/UserActivity.java
- package com.dropbox.core.v2.users does not exist
- cannot find symbol class FullAccount
I think the error is in the packages. Could you please help me out?
- Greg-DB6 years ago
Dropbox Community Moderator
This appears to indicate that the Dropbox library wasn't successfully loaded. Were you able to add it as instructed in my earlier comment? Did the Gradle sync complete successfully after that?
- cris3c6 years agoExplorer | Level 4
Hi Greg,
Finally, I achieve to get into the Dropbox Android Application but it failed when I attempted to get the list of the files I have in my dropbox account, the error is:
Additional to this, I set in the permission in the app the following check:
With that, I thought the problem must have been solved, but it is not. Always the same problem. Could you help me out?
- Greg-DB6 years ago
Dropbox Community Moderator
The 'missing_scope' error indicates that while the app is permitted to use that scope, the particular access token you're using to make the API call does not have that scope granted. Be aware that just adding a scope to your app via the App Console does not retroactively grant that scope to existing access tokens.
That being the case, to make any API calls that require that scope, you'll need to get a new access token with that scope.
- cris3c6 years agoExplorer | Level 4
Hi Greg,
Once I have checked all the scopes I need, everything I have to do is GENERATE an access token as you see in the image:
After that, have I to write that access token in any site of the android example code? If I have to, where? When it is generated, will everything be there or do I have to do something to write it somewhere in the code?
Thanks!
- Greg-DB6 years ago
Dropbox Community Moderator
Normally, you should implement the OAuth app authorization flow in your app, as shown in this example, in order to allow the end-user to connect their own Dropbox account so the app can receive the access token for that user's account programmatically once they approve it.
If you are only connecting your own account in particular though, you technically don't need to implement the app authorization flow. You can just hard-code your own access token like in this example. (Though, if you're using short-lived access tokens and refresh tokens for offline/background access, you'd want to use this constructor instead.) Note that access tokens allow access to your account though, so you shouldn't distribute them to other people.
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!