tags:

views:

36

answers:

2

How do I change the android database storage path? The default path for database storage is / data / data / databases,I want to save it to sdcard, how to do?

A: 

You can put and open the database from wherever you like, i.e.

SQLiteDatabase.openDatabase("/sdcard/mydatabase.db", null, SQLiteDatabase.OPEN_READONLY);
Mathias Lin
A: 

SQLite's openDatabase() lets you provide a location for your database.

You should use Context.getExternalFilesDir() to find the SD card's path instead of hardcoding it, though. That link has some nice code samples which you should make use of.

Josh
hi Josh,thank you
fonter