Content Providers and Database initialisation

by Gavin Aiken » Wed, 18 Feb 2009 20:54:14 GMT

Sponsored Links
I have a plethora of data which is currently stored in 1000 different very
small text files, I want to store this data in an SQLite database as I feel
that this will be more space efficient and hopefully time efficient as I
presume a database query is faster than opening and parsing a text file
(please stop me now if this isn't the case!).

The data does not need to be available to other applications and will be
used internally only. My first question is whether or not to create a
content provider anyway, is there any benefit to this?

My second question is where to initialize the database, is it possible to
ship an application with a database included already populated? Do I have to
populate it in the onCreate method of the SQLiteOpenHelper subclass? If I
have to include the 1000 text files and read, parse and insert the data at
install time I have a feeling this would be slow. Is it possible for me to
populate the database now, dump it to a single file and then bulk insert
from the file in the onCreate method?

I hope you get the jist of what I mean!

Many thanks,



Content Providers and Database initialisation

by daekpony » Fri, 06 Mar 2009 09:01:14 GMT

 hi there - did you ever get an answer to whether you can ship an
application with the database already populated? If you can, would you
mind sharing the steps to do so with us?



Sponsored Links

Content Providers and Database initialisation

by Justin Allen Jaynes » Sat, 07 Mar 2009 11:35:49 GMT

 I had a similar question and Alistair Rutherford shared this article 
link with me.  It's exactly what I was looking for and may help you as well. 



Other Threads

1. CTS not detecting Zoom2 device

Hi ALL ,

I am ruuning startcts script to run cts testtools .
I have run emulator  as well as my zoom2 device is also connected to
/dev/ttyUSB0 port

When I am doing "adb devices" . it is only showing emulator not zoom2 .

List of devices attached
emulator-5554    device

What settings required so as zoom2 will also be detected ? I want to run
startcts against zoom2 .

Thanks :


2. Moving the Gallery view to the next image on one swipe in Android?

Hi All,

I have four images in the Gallery View. When we do swipe from left to
right or right to left the Gallery View moves all the images i.e if I
swipe from left to right from the first image then it will move to all
the four images.

What I want is that when I swipe it should only move to the next
image. Can someone let me know how is this possible?

Hope to get a reply soon.



3. A Free Business Directory with Trading Platform. Add your Company

4. Eclipse + ADT + ant +make: Complex project structure

5. IP Camera + Canvas?

6. XXJD1 atau DXJC4.. pilih mana.?

7. How can I get all the name of activities in the android system ?