cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more 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: 

Read file contents

Read file contents

drewbiedu
Explorer | Level 4
Go to solution

I'm sure this is answered somewhere else, but clearly I'm not Googling the right thing. I'm working on an android app (java) and I'm trying to read the contents of a file without downloading it (needs to read every time the app opens). I was able to find plenty of examples for API v1, but nothing for v2. I have the basics, but that's about it:

DbxRequestConfig config = DbxRequestConfig.newBuilder("dropbox/my_folder").build();
DbxClientV2 client = new DbxClientV2(config, context.getResources().getString(R.string.access_token));
1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

To access the file content for a file using the API v2 Java SDK, you should use the download method. That gives you a DbxDownloader which offers a few options for using the file data; downloading it to a local file isn't required.

You can find an example Android app for the API v2 Java SDK here. For instance, it uses the download method here.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

To access the file content for a file using the API v2 Java SDK, you should use the download method. That gives you a DbxDownloader which offers a few options for using the file data; downloading it to a local file isn't required.

You can find an example Android app for the API v2 Java SDK here. For instance, it uses the download method here.

drewbiedu
Explorer | Level 4
Go to solution

Perfect, thanks! I can't tell you how many times I've scoured that page trying to figure out a way to do it. I need to stop developing so late at night

Need more support?
Who's talking

Top contributors to this post

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