1) Create a class that extends SQLiteOpenHelper and overwrite the onCreate() and onUpgrade() methods
2) In some Activity instantiate your class, created in 1) and that’s it – you will have your database created under data/data/YOUR_PACKAGE/databases/
3) If you want after that, you may obtain writable instance from the class created in 1) (getWritableDatabase()) and execute insert statements towards your database to populate it with data. Wrap your data in ContentValues and use insertOrThrow(your_table_name, null, your_content_values).
Filed under: Android
Like this post? Subscribe to my RSS feed and get loads more!