Android Phone Gap中数据库的位置 [英] Location of database in Phone Gap for Android
问题描述
我运行了Phone gap存储类的所有示例,并开发了
I run all examples of storage class of Phone gap and developed the code as mentioned in
http://docs.phonegap.com/en/2.7.0/cordova_storage_storage.md.html#Storage .
然后将在哪个位置创建数据库文件?
Then at which location the DB file will be created?
推荐答案
数据库文件的位置在android 4.4中是不同的. 我在android 4.1上的应用程序的数据库位于"file:///data/data/{package_name}/app_database/file__0/0000000000000001.db" 但在Android 4.4上,db文件位于"file:///data/data/{package_name}/app_webview/databases/file__0/1".
The location of the database file is different in android 4.4. My app on android 4.1 has the db at "file:///data/data/{package_name}/app_database/file__0/0000000000000001.db" but on Android 4.4 the db file's at "file:///data/data/{package_name}/app_webview/databases/file__0/1".
我为cordova编写了一个简单的插件,它可以区分并返回带有完整字符串的字符串db文件的路径.但是,它不是为其他平台(如iOS或Windows Phone)开发的.随时进行协作.
I wrote a simple plugin for cordova that makes this distinction and returns a string with the full path of the db file. However it's not developed for other platforms like iOS or Windows Phone. Feel free to collaborate.
这篇关于Android Phone Gap中数据库的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!