Android save app settings/data in Internal/External Storage

帅比萌擦擦* 提交于 2019-12-01 10:49:29
Igor Filippov
  1. Your limit on external storage(SDCARD) is determined only by its capacity, I'm not sure about the internal storage, maybe it's the same situation.
  2. You can extend SQLiteOpenHelper and create your own DB adapter, which will manage your database and store it on SD card or /data/databases directory. I think that it's better not to place database on SDCARD, because any other app can access it there. On the other hand, /data/ folder is private.
  3. It's tricky thing. You should be careful while copying data. Check whether directory of file exist, before writing into them. It's better to explicitly create all files and directories before trying to write to them.

Here is a good example of Database Helper for accessing database. You can modify it so it can use both external and internal storage.

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