Also, is there a recommended way to load a bunch o...
# glance
a
Also, is there a recommended way to load a bunch of images remotely in a lazy column?
m
it’s a bit tricky. Ideally you would pre-load them, store in cache and get the URI. Now, you have to make sure the URI provides read access or that the files are accessible otherwise 3rd party launchers won’t be able to display them. https://developer.android.com/training/secure-file-sharing To load the images, better use a WorkManager and once loaded, just update the widget
a
Are there any plans to make this simpler?
m
unfortunately that is a platform limitation, we are exploring ways to make the loading/async tasks simpler, but the way RemoteViews handle images cannot be changed.
a
Gotcha, that makes sense, thank you!
m
You can either use resourceIds, bitmaps or URIs. The problem with bitmaps is that you might exceed the RemoteViews max size, so URIs is the better choice
a
Gotcha, I'm currently rewriting our widget and weighing the options using this, other devs on our team decided to use bitmaps
m
if it’s small and not too many it might be okay, otherwise you might hit the size limit
a
The images are full size, some quite large
There's no CDN backing either with support of scaling down
m
you could get the available size for the widget, reduce the images locally and store them