问题描述
我怎么知道数据库是否是在Android中创建的?有人有例子吗?
推荐答案
您将在
ddms-> data/data/your_package_name/database/yourdatabase_name
请参阅第二张图像 您也可以通过命令提示符
检查数据库其他推荐答案
使用sqliteopenhelper.如果尚未创建,它将照顾创建.甚至可以使用sqliteopenhelper轻松完成更新.
可以在此处找到示例代码: android.com/resources/samples/notepad/src/src/com/com/example/android/notepad/notepad/notepadprovider.html" rel="nofollowlowlow ="nnofollow"http:/http://develover.android.com/Resources/samples/notepad/src/com/com/example/android/notepad/notepadprovider.html
问题描述
How can I know if the database has been created or not in Android? Does anyone have an example?
推荐答案
you will find the data in
DDMS -> data/data/your_package_name/databases/yourdatabase_name
see the second image you can also check database through command prompt
其他推荐答案
Use SQLiteOpenHelper. It will take care of creating, if not yet created. And even updates can be done easily with SQLiteOpenHelper.
Example Code can be found here: http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NotePadProvider.html