如何在Android应用程序安装时创建SQLite数据库?应用程序、数据库、如何在、Android

2023-09-05 09:25:08 作者:梦想不去做永远只是梦

我有注册画面作为我的第一个画面,但我想创建数据库之前。是否有可能在安装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.

推荐答案

这是一个伟大的文章,可以帮助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.