如何在Android应用程序安装时创建SQLite数据库? [英] How to create sqlite database at the time of android app installation?
问题描述
我有注册画面作为我的第一个画面,但我想创建数据库之前。是否有可能在安装android的时间来创建数据库,而不是创造的第一项活动。
I am having Registration screen as my first screen but before that i want to create database. is it possible to create database at time of installation in android rather than creating in first activity.
推荐答案
这是一个伟大的文章,可以帮助<一href="http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/">http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
This is a great article that helps http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
- 在使用SQLite数据库浏览器创建的SQLite数据库,并将其存储在您的资产产生的文件夹
- 当应用程序启动,从资产数据库复制到您的应用程序数据目录
- 打开数据库
这样,您就不必解析CSV文件或动态创建的设备上的数据库,在第一次加载节省时间。
This way you don't have to parse csv files or dynamically create the db on the device, saving time during first load.
这篇关于如何在Android应用程序安装时创建SQLite数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!