cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Chooser - Dropbox API v2 for Android

SOLVED
486 Views
4 Comments
0 Kudos
Highlighted
Level 2

Custom Chooser - Dropbox API v2 for Android

We have an Android app that runs in our proprietary android device, which does not have any browser, google play, etc., and we are not allowed to download third-party android apps as well.

 

Basically, we want the user to upload images to our app and one option that we are giving them is to use Dropbox. We want the user to select which image from Dropbox do they want to upload. I know that there is a Dropbox Chooser but since this requires me to download the app so we cannot use it.

 

So the only option that I can think of is to use webview and call "https://www.dropbox.com/oauth2/authorize?client_id=..." for authorization and when I get the token, we get the list of files (images only) from the user folder and display it. I have this working using the Metadata returned from the API but only upto the list of files using metadata.getPathLower(). The question I have is how do I display the actual images from the users Dropbox folder and show it in an Android RecycleView?

 

Please let me know for any solution. Thanks in advance.

 

 

1 Accepted solution

Accepted Solutions
Solution
Dropboxer

Re: Custom Chooser - Dropbox API v2 for Android

Based on the 'getPathLower' method you mentioned, it sounds like you're using the official Dropbox API v2 Java SDK

 

Using that, you can use the download method to download the raw file data (example here), or the getThumbnail method to download a thumbnail of the image.

 

From there, you can use that image data however you want. I can't offer help with the Android side of things though. (A non-Dropbox specific forum, e.g., StackOverflow, may be a better place for questions like that.)

4 Replies
Solution
Dropboxer

Re: Custom Chooser - Dropbox API v2 for Android

Based on the 'getPathLower' method you mentioned, it sounds like you're using the official Dropbox API v2 Java SDK

 

Using that, you can use the download method to download the raw file data (example here), or the getThumbnail method to download a thumbnail of the image.

 

From there, you can use that image data however you want. I can't offer help with the Android side of things though. (A non-Dropbox specific forum, e.g., StackOverflow, may be a better place for questions like that.)

Level 2

Re: Custom Chooser - Dropbox API v2 for Android

Thank you Greg! The information you gave is very helpful.

Level 3

Re: Custom Chooser - Dropbox API v2 for Android

howto use this class 

 

DownloadFileTask extends AsyncTask<FileMetadata, Void, File>

 

if i know file name on dropbox  and i want to download  .pls help me  to do

thank you.

Dropboxer

Re: Custom Chooser - Dropbox API v2 for Android