在编辑器上运行时,数据库正在运行,但是在android中运行时,数据库无法运行。我在互联网上尝试了很多sqlite3和libsqlite3,但仍然无法正常工作
代码连接:
public void ConnectionDB()
{
if (Application.platform != RuntimePlatform.Android)
{
Connection = Application.dataPath + "/StreamingAssets/English_Booster_Game_DB.db";
}
else
{
Connection = Application.persistentDataPath + "/StreamingAssets/English_Booster_Game_DB.db";
if (!File.Exists(Connection))
{
WWW load = new WWW("jar:file://" + Application.dataPath + "!/assets/StreamingAssets/" + "English_Booster_Game_DB.db");
while (!load.isDone) { }
File.WriteAllBytes(Connection, load.bytes);
}
}
}