Efficient Way to store images in android

让人想犯罪 __ 提交于 2019-12-18 05:51:18

问题


My application requires that when a snapshot is taken it must store in memory and next time when I restart the phone I must get a thumbnail of that photo in list of photos and the full scale photo when I click on it.

There are 2 ways I know.

  1. Store images directly. Concern here is every time it has to hit directory to get image which takes some time.
  2. Store all images in single xml. Concern here is XML will be too big and takes time to parse

Which is more efficient ?


回答1:


Definitely store the images directly as opposed to in XML. It will take time to read the image from the file system but I wouldn't worry about this taking an excessively long time.

Read through the android docs on Data Storage for more info: http://d.android.com/guide/topics/data/data-storage.html



来源:https://stackoverflow.com/questions/3393494/efficient-way-to-store-images-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!