存储大量文本的Andr​​oid应用 [英] Store large amounts of texts for Android app

查看:173
本文介绍了存储大量文本的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序中,用户将能够写入/保存/修改潜在的大段文本。相信字的量的范围为10-1000。在最坏的情况下,用户将谱写新的一段文字日常。

I'm developing an Android app in which users will be able to write/save/modify potentially large pieces of text. I believe the amount of words will range from 10-1000. In the worst-case scenario, users will write a new piece of text everyday.

什么是存储这些类型的文本数据的最佳方式,在开户轻松修改文本的保存件的能力?

What is the best way to store these kinds of text data, holding in account the ability to easily modify saved pieces of text?

推荐答案

存储数据或者的作为文件或在 SQLite数据库,如果可能的环节,这些作品作为单独的记录/文件。对于装载部分 - 不会有与RAM内的1000字的处理,例如,如果您加载一个TextView里面的任何麻烦。该限制文本的大小你分配给你的TextView基本上是你的内存容量。

Store the data either as a file or in an sqlite database, if possible segment those pieces as separate records/files. For the loading part - there won't be any trouble of dealing with 1000 word within RAM, for example, if you load it inside a TextView. The limit to the size of text you allocate to your TextView is basically the amount of memory that you have.

我建议在年底与可笑的长文测试你的文本编辑视图,如果你看到任何问题(呆滞,耗尽内存等),比你将不得不采取分段对自己的文档照顾。希望这有助于。

I suggest testing your text editing view with ridiculously long texts at the end and if you see any issue (sluggish, runs out of memory etc), than you would have to take care of segmenting the document on your own. Hope this helps.

这篇关于存储大量文本的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆