简体   繁体   中英

where on android to save files downloaded from server

I am downloading a number of images from the server. That happens once in a while (ie as needed). I need to know which is more efficient to the operation of my app: do I download the images to a HashMap of images or do I download them and save them as resources in the asset or drawable directory and then access them by id? Please do explain, at least a little, why whichever option is better.

Ideally you need to download all the images to sdcard and store them. Access them through the file apis and load them using lazy loading to your image views. If you are going to load all the images in the app resource folders, then it is going to eat up lot of memory. And keep in mind do not cache all the images on to the memory. I would suggest you to use, UniversalImageLoader from my experience. It gives you a bunch of options to play with.

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