L
L
LyoneNET2015-07-30 07:08:15
Android
LyoneNET, 2015-07-30 07:08:15

What is better to use to store text data for android?

Hello.
I can not decide how best to store test data on android. I found several options: throw small text pieces on a memory card, put all pieces of text in json, and save it in one file, the same with XML, or use a local mysql database?
The amount of data is average, for example, separate dictionaries will be stored. Each dictionary will store about 30-90 words with a description. Dictionaries can also be unlimited ...
HTML is not suitable ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valery Ryaboshapko, 2015-07-30
@LioneNET

SQLite is designed specifically for such tasks.

B
Bob, 2015-07-30
Smiley @blackrid

If the texts are small, you can use localStorage

var prefix = 'my_app_unique_prefix';
var setItem = function( item, value ) {
  window.localStorage.setItem( prefix + item, value );
};
var getItem = function( item ) {
  return window.localStorage.getItem( prefix + item );
};
setItem( 'testvalue', 'blablabla' );
console.log( getItem( 'testvalue' ) );

If you pass arrays or objects, put them in JSON, and then back.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question