Most efficient way to store and retrieve large amounts of text data in android

坚强是说给别人听的谎言 提交于 2019-12-10 19:26:22

问题


I wanna write an android application which will store and retrieve large amounts of text data. I wanna store text in paragraph wise.I need to manipulate this text data in an efficient way. What will be the best way for doing this?


回答1:


I think the best way is to save all data inside a file. And save this file to specified location in sdcard. If you are saving data inside a file you will get same format as you saved(e.g Paragraph wise in your case).And you can delete file when ever you want.

I found this may this help you to solve your issue

SharedPreferences is apparently implemented internally as an XML file which is serialized and deserialized in full on update. And it's a Key-Value store with no index. So use that only for simple data associated with your app. Any more than 50 keys and you've probably overdone it.

ContentProvider is intended for sharing data across applications. You've explicitly said you don't want to do that.

SQLiteDatabase is intended for individual apps to store data, and provides a lot of flexibility to store and index data in different ways. I personally use it to store logs in one of my apps. I'd recommend that route.

See this discussion for more details



来源:https://stackoverflow.com/questions/11732907/most-efficient-way-to-store-and-retrieve-large-amounts-of-text-data-in-android

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