我要如何改变在Android数据库存储路径?用于数据库存储的默认路径为/数据/数据/数据库,我想将它保存到SD卡,怎么办?
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?
的SQLite的的openDatabase()
让你为你的数据库提供一个位置。
SQLite's openDatabase()
lets you provide a location for your database.
您应该使用 Context.getExternalFilesDir()找到,而不是硬编码的SD卡的路径,但。这种联系有一些不错的code样,你应该充分利用。
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.