cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reading content from a file and show it WITHOUT downloading

Reading content from a file and show it WITHOUT downloading

cris3c
Explorer | Level 4

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 (.txt, .html, .jpg whatever file is displayed there) and display it on the screen of the simulator without download that file in any folder (reading directly from Dropbox). I am new with the API, could anyone share with me an example code to archieve it? or send me any information about that.

 

Thank you.

13 Replies 13

cris3c
Explorer | 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:

Captura.PNG

Additional to this, I set in the permission in the app the following check:

Captura.PNG

With that, I thought the problem must have been solved, but it is not. Always the same problem. Could you help me out?

Greg-DB
Dropbox Staff

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.

cris3c
Explorer | 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:

Captura.PNG

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-DB
Dropbox Staff

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    cris3c Explorer | Level 4
What do Dropbox user levels mean?