Content Providers and Database initialisation

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


Sponsored Links
 Hey,
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,

Gav

--~--~---------~--~----~------------~-------~--~----~



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?

thanks!



--~--~---------~--~----~------------~-------~--~----~


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.

 http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ 


Justin






--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. how to enumerate all character sets supported by android platform?

Hi All,

I want to know all the names of character sets(as know as "character
encoding") that are available on the android platform, I searched that
how to enumerate it but didn't find.

Anyone knows how to do it?Thanks.

Droy

--~--~---------~--~----~------------~-------~--~----~

2. CPhone To Rival OPhone, iPhone

Operator lokal kalau bundling android dg nama KlePhone mungkin laku kali
yah, sebab namanya indonesia dan familiar banget..hehehehehe.

 


CPhone To <http://phandroid.com/2009/09/21/cphone-to-rival-ophone-iphone/>
Rival OPhone, iPhone


by Rob <http://phandroid.com/2009/09/21/cphone-to-rival-ophone-iphone/>
Jackson on September 21st, 2009 

*        

 


 

China Unicom will have Apple's iPhone. China Mobile has their Android-based
Open Mobile System phone dubbed OPhone. Now China Telecom could acquire a
phone/platform based on Android and created by Access called CPhone:

access_cphone

Interesting UI. ClonedInChina
<http://www.clonedinchina.com/2009/09/access-android-mobile-cphone-at-pt-net
work-comm-china.html>  called it "cartoon style" while Engadget
<http://www.engadgetmobile.com/2009/09/21/access-and-china-telecom-in-talks-
to-launch-cphone-custom-androi/>  was a little more liberal with their
criticism, insinuating it was created by drunk people. The Access CPhone
comes with Android 1.5 and apparently the media are already calling it an
OPhone killer. Funny how they just glazed right over that "i" one isn't it?

Also interesting that they chose a consonant instead of a vowel to precede
"phone" - maybe that is the differentiation they were seeking? The only
vowels remaining are A, E, U and Y if you accept it as a vowel. APhone,
EPhone, UPhone, YPhone? I would take the "E" over "C" any day and the "A"
and "Y" just seem plain silly. Does the "C" even stand for something? China?
China Telecom? Or am I missing something here?

 


--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group, please visit the following page:
 

3. Anyone use SIM5210 as baseband module?

4. the rooted G1 phone == the dev phone == the unlock G1 phone ?

5. surface flinger restarts phone

6. catching "The application XXX (xxx)...has stopped unexpectedly. Please try again. [Force close]"

7. Any news about ADC2 ???