附带数据库的应用程序

痴心易碎 提交于 2020-08-10 12:52:25

问题:

If your application requires a database and it comes with built in data, what is the best way to ship that application? 如果您的应用程序需要一个数据库,并且它带有内置数据,那么最好的运输方法是什么? Should I: 我是不是该:

  1. Precreate the SQLite database and include it in the .apk ? 预先创建SQLite数据库并将其包含在.apk

  2. Include the SQL commands with the application and have it create the database and insert the data on first use? 在应用程序中包括SQL命令,并让它创建数据库并在首次使用时插入数据吗?

The drawbacks I see are: 我看到的缺点是:

  1. Possible SQLite version mismatches might cause problems and I currently don't know where the database should go and how to access it. 可能的SQLite版本不匹配可能会导致问题,并且我目前不知道数据库应该去哪里以及如何访问它。

  2. It may take a really long time to create and populate the database on the device. 在设备上创建和填充数据库可能会花费很长时间。

Any suggestions? 有什么建议么? Pointers to the documentation regarding any issues would be greatly appreciated. 有关任何问题的文档指针将不胜感激。


解决方案:

参考一: https://stackoom.com/question/29TY/附带数据库的应用程序
参考二: https://oldbug.net/q/29TY/Ship-an-application-with-a-database
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!