-1

I have a question about databases in Android. I want to use a database in my app but I dont want to create it there. My question is now, is there a way to create a SQLite database with a specific programm on PC or is it even possible to convert an Access database into a SQLite database and then import it into my app? It will be a "static" database and the app will only have to read it. Thanks for your help

Hibuja
  • 43
  • 2
  • look at here : http://stackoverflow.com/questions/3548533/full-android-database-helper-class-for-existing-sqlite-database – Hosein Jul 28 '12 at 08:42

2 Answers2

1

You can use SQlite3 database as an internal storage in android.For that you can use SQLite3 Manager.You can get it here http://sqlitemanager.en.softonic.com/. You have to extend SQLiteOpenHelper class to use it.For more detail to use database in android please refer this link http://www.androidhive.info/2011/11/android-sqlite-database-tutorial/.

Akshay
  • 2,506
  • 4
  • 34
  • 55
0

First create your database (with any tools for SQLite), put it in your assets directory, and on first use copy to /data/data/YOUR_PACKAGE/databases/ directory. then use this path to connect your database. See android.database.sqlite.SQLiteDatabase.openDatabase() that will access a database given a file path.

SQLiteDatabase db = SQLiteDatabase.openDatabase(yourDbPath, null, 0);

See Using your own SQLite database in Android applications.

Ria
  • 10,237
  • 3
  • 33
  • 60