简体   繁体   English

如何在Android中存储大文本资源(最大100mb)

[英]How to store big text resources in Android (up to 100mb)

I want to make text reader in Android. 我想在Android中制作文本阅读器。 There are 20000 text files with summary size of, maybe, up to 100mb. 有20000个文本文件,其摘要大小可能最多为100mb。 The application must be able to read the texts offline. 该应用程序必须能够脱机阅读文本。 I do not know how to implement it. 我不知道如何实施。 If we put all the texts in the apk-file, it will turn out giant-sized (4mb of apk + 100mb of text). 如果我们将所有文本放在apk文件中,结果将变成巨大的大小(4mb apk + 100mb文本)。 It can be more convenient to store the text in a single file? 将文本存储在单个文件中会更方便吗? Maybe I can use archives? 也许我可以使用档案? Maybe I can use a swap file after installing? 也许我可以在安装后使用交换文件? Help needed! 需要帮助! Thanks! 谢谢!

I created an app with 300 Mb text. 我创建了一个300 Mb文本的应用程序。 I uses SQlite DB because i needed fast search in my case. 我使用SQlite DB是因为我需要快速搜索。 Then I archived DB, put in assets and extract on first run. 然后,我将数据库存档,放入资产并在首次运行时进行提取。 Result archived DB was 56 Mb. 结果存档的数据库为56 Mb。 In your case you may do the same. 在您的情况下,您可以这样做。 But you don't need use a sqlite if you don't need search, relation data etc. Is not so much choice really, database or text files depending on the requirements 但是如果您不需要搜索,关系数据等,则不需要使用sqlite。实际上,数据库或文本文件的选择不是很多,具体取决于需求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM