tags:

views:

118

answers:

2
+1  Q: 

SQLite on Android

Greetings,

I'm looking in the documentation for SQLite on Android but can't seem to find the anser for my question - so maybe someone here can help.

When I create a database using the SQLiteOpenHelper will the database only be created once if it does not exist or will it be overwritten each time I call the OnCreate method.

+6  A: 

It will be created once if it does not exist.

Anthony Forloney
+3  A: 

You don't actually want to call the onCreate() yourself... the helper will do it for you. But yes, it'll only be created once.

If you check out the Notepad example in your local copy of the SDK (SDK/platforms/android-1.6/samples/NotePad) the com.example.android.notepad.NotePadProvider class has a full example.

fiXedd