Quick question - storing application state

Quick question - storing application state

Post by Josh » Wed, 02 Jul 2003 06:51:42



I've got a simple application that uses a few controls on the screen
(lists, push buttons, fields) to create a string and copy it to the
clipboard.  Pretty straightforward.  My problem is that when I leave
the application and return, the control values are reset; I'd like the
user-selected values to remain.  Is there any way to do this outside
of creating a database?  The documentation suggests I might use
PrefSetAppPreferences to store this info.

Thanks,
Josh

PS Just started with Codewarrior & Palm 1 1/2 weeks ago.  Crummy C
programmer as well.

 
 
 

Quick question - storing application state

Post by Elvin N » Wed, 02 Jul 2003 23:16:43


Use the Features...emmm feature (FtrSet and FtrGet). The saved states will
be gone after a soft reset though.

To let the settings survive a soft reset, use appl database as you have
mentioned, in addition to Feature.

By using preference, every changes you have made will be hotsync'ed. Unless
you want to do so (hotsync the preferences every time), it's not advisible.

elv

Quote:> I've got a simple application that uses a few controls on the screen
> (lists, push buttons, fields) to create a string and copy it to the
> clipboard.  Pretty straightforward.  My problem is that when I leave
> the application and return, the control values are reset; I'd like the
> user-selected values to remain.  Is there any way to do this outside
> of creating a database?  The documentation suggests I might use
> PrefSetAppPreferences to store this info.

> Thanks,
> Josh

> PS Just started with Codewarrior & Palm 1 1/2 weeks ago.  Crummy C
> programmer as well.


 
 
 

Quick question - storing application state

Post by Josh » Thu, 03 Jul 2003 04:33:33


Elvin:

Thanks for the reply.  I did some reading in the Palm OS Companion
(was using the reference almost exclusively before), and it appears
that you can avoid hotsyncing the preferences by using the unsaved
database (please refer to pg. 321).  Reading further, it looks like
app prefs is the recommended method to save application state.  I'm
pretty far along in implementing it (thanks in part to CW prefs stubs
in template code).  Please let me know if you have any further
suggestions or questions.

Thanks,
Josh


> Use the Features...emmm feature (FtrSet and FtrGet). The saved states will
> be gone after a soft reset though.

> To let the settings survive a soft reset, use appl database as you have
> mentioned, in addition to Feature.

> By using preference, every changes you have made will be hotsync'ed. Unless
> you want to do so (hotsync the preferences every time), it's not advisible.

> elv


> > I've got a simple application that uses a few controls on the screen
> > (lists, push buttons, fields) to create a string and copy it to the
> > clipboard.  Pretty straightforward.  My problem is that when I leave
> > the application and return, the control values are reset; I'd like the
> > user-selected values to remain.  Is there any way to do this outside
> > of creating a database?  The documentation suggests I might use
> > PrefSetAppPreferences to store this info.

> > Thanks,
> > Josh

> > PS Just started with Codewarrior & Palm 1 1/2 weeks ago.  Crummy C
> > programmer as well.