[android-developers] Re: Database on a G1

2008-10-23 Thread Mark Murphy

ScottG wrote:
> Anybody have any recommendations on building a SQLite database on a G1
> phone?  On the emulator one can simply go to /data/data/.../databases
> and build the database that your application needs.
> 
> Of course it doesn't have to be here but I can't find anywhere on the
> G1 that I have write permission.
> 
> Is there a recommended place that one can and should build an
> application's database on the G1?

You should let Android build it and let Android put it in its proper place.

If you look at the NotePad example in the SDK, you will see how it uses 
DatabaseHelper to run the DDL necessary to create the notes table. While 
the database name (note_pad.db) is specified, it does not specify a path 
-- Android handles that for you.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Database on a G1

2008-10-23 Thread ScottG

Thanks much for the suggestion, Mark.

A method that works during development when you want to test with
various populated databases
is to cd into /sqlite_stmt_journals and build your database there (or
in a subdirectory, of course).

sqlite3 won't run on the G1 so you have to build your database (using
sqlite3 -init foo.sql db, for example)
in the emulator and then move the resulting database to the G1.  Most
amazingly it works.

Cheers, Scott
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---