Android, Not sure if I should store to the internal storage or external storage

强颜欢笑 提交于 2019-12-13 04:29:43

问题


I have an app out there on the market already The app is not a game just an informative app with lots of pictures and stats and I received a comment from someone stating that the size of the app being 20Mb is being stored on the "internal storage which isn't fair and that some of it should be stored on the SD card."

Now I am still trying to learn everything about android coding but is this a big deal so that I should move all those images to the external storage like the SD card? Is 20Mb to the internal storage too much or what number in Mb should I look out for to know when to store to an external? I looked at the storage documentation here and it states that the user can modify when they enable USB mass storage to transfer files on a computer, so does this pose a risk to my app breaking if the user modifies/removes/changes anything?


回答1:


You are looking for installLocation. Just change one thing in the manifest and let users choose where the APK is installed.

Note: By default, your application will be installed on the internal storage and cannot be installed on the external storage unless you define this attribute to be either "auto" or "preferExternal".




回答2:


This is no different to a computer having two hard drives, a boot disk and a second disk.

Obvious if you can store using the second disk/external storage, you are generally better off as the internal storage has many uses and usually fills up first.

Generally speaking it is best to leave it to the user to decide but I would store on the external storage by default.




回答3:


For an older phones it is a big deal, believe me. The best option would be to let user choose, which storage he wants to use, in some sort of configuration dialog.




回答4:


If the app requires those files then do not put them in external storage as that will allow the user to remove them.

If they can be removed/altered then you should put them in external storage.

You could also do a mix of the two so that the size could be reduced without sacrificing the necessary components.



来源:https://stackoverflow.com/questions/16860791/android-not-sure-if-i-should-store-to-the-internal-storage-or-external-storage

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