Justin Allen Jaynes wrote:
> I couldn't deal with a 5 minute startup time on an app, so I decided to 
> include the actual database file in my resource raw folder (others 
> suggested this to me).  

One potential flaw with put-the-database-file-in-the-APK approach is
SQLite file format. Suppose Android 1.5 includes an update to SQLite
that causes the SQLite file format to change, such that SQLite cannot
read your binary database file you packaged up? Now your app is "broken"
for newer Android devices.

It may be that SQLite will be backwards compatible, or it may be that
this is just unlikely to happen. However, it is a risk developers need
to keep in mind.

The same general argument holds true for packaging the data in the form
of SQL statements, though given that SQL is more or less a standard, I
would expect fewer problems this way...performance notwithstanding.

Obviously, given the performance characteristics in your case, if SQLite
has to be the answer (see below), then you have no choice but to package
the binary database and pray.

> (mine is a large word dictionary 
> and the whole app after first run takes 4 meg)

Another thing to consider with large yet simple database structures is
whether SQLite is the right answer at all. This is particularly true if
the data is read-only or read-mostly. It may be you are better served
finding a Java library implementing a lower-level data structure
(red-black tree, AVL tree, etc.) that is better tuned for your scenario.
You might even find one that can work efficiently with an InputStream,
thereby allowing you to keep the data in the APK without a second copy.

For example, when I see "large word dictionary", I think of
spell-checkers, and implementing a spell-checker with a SQLite backend
would seem likely to have poor performance. Of course, then again, it's
been about two decades since I wrote my last spell-checker...

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android Training in Sweden -- http://www.sotrium.com/training.php

--~--~---------~--~----~------------~-------~--~----~
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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to