9 messages in com.googlegroups.android-beginnersRe: Creating a new sqlite database
FromSent OnAttachments
sudhir28 Jan 2008 06:50 
Patrick Petermair28 Jan 2008 07:23 
bushpig28 Jan 2008 09:33 
ultraklon29 Jan 2008 06:34 
muntzen29 Jan 2008 06:46 
sudhir29 Jan 2008 07:39 
muntzen29 Jan 2008 11:41 
Megha30 Jan 2008 13:56 
GodsMoon28 Feb 2008 07:13 
Subject:Re: Creating a new sqlite database
From:muntzen (eric@gmail.com)
Date:01/29/2008 11:41:07 AM
List:com.googlegroups.android-beginners

For what it's worth, you don't have to pull them into memory or do one- at-a-time, you can insert multiple records into a database in one statement, the statement is just a String in a resource file. It would be nice to bundle a data file with your application to deploy at install-time, if that's possible. Anybody know how to go about doing that? What about a dat file you can do a "load <file> into <table" with?

On Jan 29, 10:40 am, sudhir <sudh@yahoo.com> wrote:

The application I am building would have a sizable number of records preinstalled. I dont think creating a DB at the start and installing a record at a time is a good idea. It would take too much time when the app starts and twice the memory for the same record, one in DB and another in code.

Part of my question was answered in another post. I could open a DB file using the openDatabase method.

I would like to know if there is a sqlite tool I could use to create a DB on my development platform and attach it to the android app.

Thanks

On Jan 29, 9:46 am,muntzen<eric@gmail.com> wrote:

I'm doing what ultraklon noted. I put a file in the resources bundle that has the initial database seed sql statements, then at startup I detect if it's an initial run and create and seed the database.

I also have a SplashScreen activity that shows an image or animation while a background thread does all the initialization of the application - creating databases, app preferences, maybe starting background services (but, not for me, my services are lazy initialized and not started until they're needed), checking to see if the user is "registered", and the like.

On Jan 29, 9:35 am, ultraklon <ultr@gmail.com> wrote:

I had to do that and i just... created a method that is executed at the start of the application and it checks that the database exists, if not, it create the database and do the inserts.