The problem with just using a db created on your desktop (as opposed
to pulling one off the emulator) is trusting the endianness of your pc
is the same as the target device, and the db versions match.  Safer to
just adb pull from an emulator and store it.
On May 14, 12:41 am, "Mark Murphy" <[email protected]> wrote:
> > Basically, saving off a database from the emulator and blowing it up
> > as a raw at runtime seems to  work. Just create the database and store
> > it on the emulator. Then use "adb pull" to pull the database from the
> > emulator onto your desktop.  Drop this .db in your project resources/
> > raw directory.
>
> Note that your technique should also work for SQLite databases created
> outside of the emulator. So long as you are running the same major release
> of SQLite, the file format will be the same. Hence, if you want to use
> some desktop tools to create the SQLite file you are "baking into" your
> APK as a raw resource, that should be fine.
>
> Also, bear in mind that you are now taking up ~1.5 times the amount of
> on-board flash space -- you have your full-size uncompressed copy, plus
> the original compressed one. There is no way to get rid of the raw
> resource after you are done with it. For small databases, this is not an
> issue, but I would not pack a large database in this way (e.g., 15MB).
>
> Finally, others have reported errors when attempting to expand large files
> out of the APK. I think the limit was 1MB or 2MB.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 2.0 Available!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to