Android预填充数据库 [英] Android Pre-Populated Database

查看:92
本文介绍了Android预填充数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Android应用程序,在用户可以使用该应用程序之前,该应用程序需要在该应用程序的数据库中填充几个条目(单个表,包含1000-10000行)。我看过一些教程,我不确定最好的方法做到这一点。我应该检查数据库是否存在每次应用程序启动时,如果不存在,创建它,并插入成千上万的记录我需要?还是有更好的方法来处理这个问题?理想情况下,它可以作为应用程序安装过程的一部分,但我不知道这是否可能。

I am working on an Android application that will need several entries (a single table, with 1000-10000 rows) populated in that app's database before the user can use that app. I've looked around some tutorials and I am unsure of the best way to do this. Should I just check if the database exists each time the app is started and, if it isn't there, create it and insert the thousands of records I need? Or is there a better way to handle this problem? Ideally, it could be included as part of the app's install process, but I'm not sure if this is possible. Any feedback would be greatly appreciated.

推荐答案

此链接有很好的答案使用数据库运送应用程序

这篇关于Android预填充数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆