简体   繁体   中英

How use UIL with dropbox http api

This is how a download works( https://www.dropbox.com/developers/documentation/http#documentation-files-download )

curl -X POST https://content.dropboxapi.com/2/files/download 
  --header "Authorization: Bearer myToken" 
  --header "Dropbox-API-Arg: {\"path\": \"/Homework/math/Prime_Numbers.jpg\"}"

As you can see this way let you download different images with same url.

Should I create a new instance for loader every single image? Which it not seems possible because I don't know how many images will I have.

I had realised that displayImage have an expected DisplayImageOptions parameter. So i created one with my custom parameters

DisplayImageOptions customOptions = new DisplayImageOptions.Builder()
        ...
        .extraForDownloader(headers)
        .build();

Then in loader ensuring path is different every time, I achieve it using #

path = path+"#"+my_unique_id;
loader.displayImage(path, view, defaultOptions, listener);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM