【发布时间】:2015-11-24 17:28:31
【问题描述】:
我正在尝试将本地 SQLite 数据库存储在设备的内部存储中。当我使用模拟器时,这是:
static string dbName = "totems.sqlite";
string dbPath = Path.Combine (Android.OS.Environment.ExternalStorageDirectory.ToString (), dbName);
工作正常。但是当我尝试在我的 Nexus 5 上进行调试时,它不起作用,因为它没有外部存储。我搜索了它的存储位置,以便它也可以在我的 Nexus 上运行。我将其替换为:
static string dbName = "totems.sqlite";
string dbPath = Path.Combine ("/data/data/com.companyname.totem/databases/", dbName);
但现在它不能在我的 Nexus 5 上运行,也不能在我的模拟器上运行。它说它找不到路径。
我做错了什么?
提前致谢。
【问题讨论】: