I'm creating an app and I would like to keep my images on Dropbox and keep URL to them in a database.
I tried to load a sample image https://www.dropbox.com/s/vqm2hw87sjt9pde/sample.jpg?dl=0
However, it doesn't load my image. Logcat isn't very helpful
05-04 22:36:50.829 30881-30881/eu.szwiec.checkittravelkit D/NetworkSecurityConfig: No Network Security Config specified, using platform default
05-04 22:36:50.835 30881-30886/eu.szwiec.checkittravelkit I/zygote64: Do full code cache collection, code=83KB, data=81KB
After code cache collection, code=65KB, data=57KB
05-04 22:36:51.130 30881-30905/eu.szwiec.checkittravelkit D/OpenGLRenderer: endAllActiveAnimators on 0x7c05121800 (RippleDrawable) with handle 0x7c0f268b80
05-04 22:36:52.046 30881-30917/eu.szwiec.checkittravelkit D/skia: --- SkAndroidCodec::NewFromStream returned null
05-04 22:36:53.457 30881-30926/eu.szwiec.checkittravelkit D/skia: --- SkAndroidCodec::NewFromStream returned null
This image is loaded without a problem https://lh6.ggpht.com/9SZhHdv4URtBzRmXpnWxZcYhkgTQurFuuQ8OR7WZ3R7fyTmha77dYkVvcuqMu3DLvMQ=w300
Can I modify my URL somehow? If not, which image hosting works well with Picasso?
I found the solution.
The official way to create a direct link is to first create a share link using the regular process, and then change the ?dl=0
at the end with ?dl=1
. The resulting link will be a direct download of the file you've linked. You can also change ?dl=0
to ?raw=1
if you need to embed the file (an image, for instance) in a web page.