Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store large amounts of texts for Android app

Tags:

text

android

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?

like image 703
BBB Avatar asked May 09 '13 09:05

BBB


1 Answers

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.

like image 135
ılǝ Avatar answered Oct 20 '22 06:10

ılǝ