Search PalmPower's 487 Palm-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Setting application preferences (continued)

Another addition for OS 2 is that you can delete the preferences for your application by calling PrefSetAppPreferences with a length of zero.

Palm OS version 3
The Palm III came with even more improvements and changes. Fortunately, the only change to the system preferences structure were changing the names of the sound levels, and adding new preferences to the end of the structure.

Look at http://www.component-net.com/pp-extras/prefs3.html to see shows the system preferences structure for Palm OS 3.

Handling rocketship preferences
Ok, so how does all this work? Look at Rocketship at http://www.component-net.com/pp-extras/prefs4.html and you'll see I've added two routines; ReadAppPreferences to load the preferences when Rocketship starts, and SaveAppPreferences to save them as the application exits.

To determine which APIs should be used, another routine (GetOSVersion) returns the Palm OS version number. The load and store routines check which OS is running and use the appropriate routines.

For this program, there's not much being stored, and that which is being stored is placed in the saved preferences, so why bother checking which OS is running? Why not just use the OS 1 APIs or the OS 2 APIs?

If I use the OS 2 APIs, then the program won't run on Pilot 1000s and 5000s. There's no reason to needlessly exclude those machines. And if I just use the OS 2 APIs, there's a risk that a future machine would support the newer APIs and not the older ones. If that happens, then Rocketship would crash on it. Of course, some future machine may not support either API, but the newer APIs are supported on the Palm III so it's likely they'll be supported longer.

Additionally, I wanted to show you how to determine what OS you're running under. If you're reading system preferences, you need to know what preferences are there, and you need to deal with the structure changes between OS 1 and OS 2.

Next month
Next month we'll add a few new things to Rocketship, making it into a playable game. It'll still be simplistic, but be more entertaining than it currently is.

Product availability and resources
Source code and executable for this project is at http://www.ajw.com/PalmPower/ProgrammingPower/Oct98/Rocketship.zip.

3Com's database of creator IDs is at http://www.palm.com/devzone/crid/cridsub.html.

Alan Weiner has many preferences - primarily chocolate. His email address is alan@ajw.com.


« Previous  ·  1  ·  2  ·  3  ·  4
Other articles you might like
Home > Phones and PDAs > Palm and Treo > Programming (24 articles)
   How PDA software is born
   Program with Simplicity
   Kinectivity 2.0 brings enterprise application developers new tools
Home > Games > Palm Games > Writing a Game (3 articles)
   Finishing up Rocketship
   Rocketship: writing a PalmPilot game
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Other PalmPower Articles
Palm gets up to date with new Tungsten family of handhelds
Create handwritten email with riteMail
Presenter-to-Go puts PowerPoint presentations on your Palm OS handheld
Looking for the cutting edge
Gain remote access to databases and PLCs
PalmSource Open House showcases what's new in the Palm community
Analysis: handheld market share
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
DominoPower: Application development, William Shatner, and the origin of the universe
OutlookPower: More about disappearing text
-- Advertisement --

NO HASSLE PHOTO PRINTING, SHARING, AND STORAGE -- AS LOW AS $2.54 PER MONTH
Discover an easier way to share, print and manage your photos online! Get your own online photo album site for sharing photos, as well as easy-to-use editing tools to make sure your photos look their very best. You can even order high quality prints directly from your album -- and have them delivered right to your door!

Best of all, you can also get login-free photo sharing at your personal domain name (if you have one), so your friends and family don't have to hassle with signing up or logging in just to view your pictures. It's the perfect solution for sharing, printing and storing all your favorite images!

And it's only from The Duck! Tap here to get started.

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login