简体   繁体   中英

Which is the best way to display images in Android?

so im developing an app that shows a lot of images to the user. The problem im facing is that currently for the prototype,ive stored my images in the drawable folder. But this seems to slow the app down loading images and usually gives a OutofMemory error. so after some searching iv figured out that i can

1) Load them from a sqlite Databse or

2) download them from a server/cloud on the first run of the app and use them from a particular directory

which one of these would be the most appropriate and efficient as il be using images that are mostly above 1MB?

25 images of about 1MB are not a big amount of data for an APP.

The problem here is the weight of every individual image. In your case, I recommend you to store them in a SQLite database because what makes your phone slow is dealing with every single image, the time to load them.

If you store them in a server you will have to add your load time to your download time...

Dummy advise: make them smaller xD

I hope this would help you ;)

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