BBB
BBB

Reputation: 615

Store large amounts of texts for Android app

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?

Upvotes: 6

Views: 3342

Answers (2)

ılǝ
ılǝ

Reputation: 3528

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.

Upvotes: 2

Dhaval Parmar
Dhaval Parmar

Reputation: 18978

Best option Use sqlite database if you want to store data by day or by time. So, you can easily manage all your data.(if you looking for storage capacity then you can also manage your database in SDCARD(take backup in SDCARD, or create DB in SDCARD...etc.))

2nd Option store Data directly in SDCARD external storage(readable to user(He/She can Delete your data)).

you can use Encryption & Decryption in above both way.

Upvotes: 0

Related Questions