Can I embed a sqlite database in an Air application?

旧城冷巷雨未停 提交于 2019-12-12 13:06:17

问题


Is it always necessary to create a database for the user in an adobe air application or can you ship an empty database as part of the distributed app?


回答1:


Look up the section 'Distributing a pre-populated database' in Flex 3.0 documentation. From the documentation:

[...]As an alternative to creating the database, structure, and data programmatically, you can distribute a pre-populated database with your application. To distribute a predefined database, include the database file in the application's AIR package.

Like all files that are included in an AIR package, a bundled database file is installed in the application directory (the directory represented by the File.applicationDirectory property). However, files in that directory are read-only. Use the file from the AIR package as a "template" database. The first time a user runs the application, copy the original database file into the user's application storage directory (or another location), and use that database within the application.

So, the answer to your question:

can you ship an empty database as part of the distributed app?

is yes!



来源:https://stackoverflow.com/questions/573350/can-i-embed-a-sqlite-database-in-an-air-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!