Tony
Tony

Reputation: 3805

Storing little amount of data in android

There are 2000 records of data. The only thing I want to do with records is getting values(no removing or editing). Data is not hard-structured. I can treat data as key-value storage. I'm going to init data from file (about 1mb) when app starts and then keep it in array or hashtable. Is that a good idea to store it in memory?

Upvotes: 1

Views: 122

Answers (2)

Frankely Diaz
Frankely Diaz

Reputation: 906

I think is not good idea to have that data in memory, because you will have to keep the data in every android lifecycle step, although you can store the data in key-value i think you should store it in a database and access it throught a content provider.

Content Provider Basics: http://developer.android.com/guide/topics/providers/content-provider-basics.html

Upvotes: 1

Ranjithkumar
Ranjithkumar

Reputation: 18426

Using large amount of data, best practice is sqlite

Here is very good SQLite tutorial.

another tuorial http://www.screaming-penguin.com/node/7742

Upvotes: 0

Related Questions