Skip to content

Pre populated databases

powerje edited this page Mar 16, 2013 · 6 revisions

To use a pre populated database place a copy of it in the assets directory. To ensure the database works properly with Android take the following steps:

  • Setup the android_metadata table
    CREATE TABLE "android_metadata" ("locale" TEXT DEFAULT 'en_US')

    INSERT INTO "android_metadata" VALUES ('en_US')
  • Rename all the primary key fields to named Id (not _id like standard Android databases)

Notes

This will cause duplication of the database as it will be packaged with the apk and copied into the /data/data/yourpackage/databases directory as well.

Clone this wiki locally