-1

I have an application where a certain data (about 100 rows) has to be stored in db before every start of application. I do not want to insert it every time when user starts app. What is the solution? How to store datas? What is the best way?

Manuel
  • 10,153
  • 5
  • 41
  • 60
Stas
  • 1,355
  • 6
  • 22
  • 40
  • 1
    http://stackoverflow.com/a/11684768/1300995 or insert data in `onCreate()` method of your `SQLiteOpenHelper`, this way you insert data only once when the db is created – biegleux Jul 30 '12 at 08:00

1 Answers1

1

The onCreate method is the one that is run once by every app on its launch. Here you can have your code to insert the values in the DB.

Also you can connect to your DB and see if it already exists and if not perform the creation and insertion.

Refer these link's for more idea on DB in Android...

http://www.codeproject.com/Articles/119293/Using-SQLite-Database-with-Android

Errol Dsilva
  • 177
  • 11