So I just looked at the Unsaved Preferences database on my device.  Here's what
it looks like:

Database on card 0
 name: Unsaved Preferences
 type pref, creator psys

resource 'psys'=3....
resource 'sync'=1....
resource 'sync'=2....
resource 'sync'=3....
resource 'psys'=4....
resource 'psys'=1....
resource 'addr'=-3....
resource 'lnch'=-3....
resource 'memo'=-3....
resource 'date'=-3....
resource 'RPTD'=0....
resource 'HBAL'=0....
resource 'Runr'=1....
resource 'SUBH'=0....
resource 'pref'=1....

I look at a lot of apps, but obviously not all ever made.  Of those listed, only
one (Runr) isn't by Palm or myself.  My take on this is that the Unsaved
Preferences are very underutilized.  Ideally it just that folks don't understand
them.  So if I explain it again, things can change.  All ideally of course... :)

So the point of the Unsaved Preferences is to avoid transferring large data
during HotSync if it's not fairly important to backup.  For instance, Reptoids
saves current games as unsaved preferences.  A game is 5K.  We don't really want
to transfer this for every HotSync and slow that process down.  After a hard
reset, folks care about their address book data, not their current Reptoids
game.  The high scores should be saved though.  A lot of effort probably went
into them, and they're small.

Another point is that if something doesn't need to be saved, don't.  When the
game is over in Reptoids, and the game is exited, the saved game data is
deleted.  That's 5K back to the user!

There are lot's of variations on this.  Don't just always write preferences.  If
the user starts an app and exits, without changing anything, it would nice if no
extra preferences or database exist.  Until preferences are changed by the user,
use default ones everytime.  Delete empty databases when exiting.

I've actually seen a number of databases with no or one record in them.  Moving
that one record to a preference file reduces the memory overhead some more.

There are often good reasons why what I've just said isn't the right thing to
do.  And some of our apps at Palm seem to need some updating too.  But hopefully
those who just didn't realize the problem now do...


-Roger Flores



Reply via email to