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)

Saving and restoring preferences
Using Palm OS preferences is simple: special APIs read and write them. These APIs simply save a user-defined structure. You put whatever data you want in that structure. You don't need to open the database or know an index or record number; these APIs refer to the data by the application's Creator ID.

Early Pilot 1000s and 5000s running Palm OS version 1 only used a single preferences database. When the PalmPilot came out with Palm OS version 2, it added an additional database and several more preferences APIs.

Initially the preferences database was backed up like any other database. Typically this is what you want. If the PalmPilot's memory is wiped out and restored from the backups, all the application preferences are restored as well. This database is called the "saved preferences."

PalmOS version 2 added the "unsaved preferences" database. Just as you'd expect from its name, this database doesn't get backed up. If the Palm device is hard-reset and reloaded from backup data, those unsaved preferences are gone. Personally, I don't see any use for it. I always save preferences. I'd rather take a few extra moments when I HotSync and be sure that I can restore everything to exactly the way it is now. But perhaps you have data that needs to survive between runs, but needn't (or shouldn't) be backed up. Then you'd use the unsaved preferences.

You use the same APIs for saved and unsaved preferences. The last argument in the call determines which database you're saving into.

Creator IDs
Each application is identified by a 32-bit value called the Creator ID, displayed as four characters. The Palm Creator Database web site says to use characters in the ASCII range from exclamation mark through tilde; 0x21 through 0x7E. Palm maintains a database of creator IDs used by existing applications. This database may be read at http://www.palm.com/devzone/crid/cridsub.html. You can register new creator IDs at this same address.

In the case of Hello World and last month's Rocketship, I used a creator ID of "XXXX". As Rocketship will evolve into a real application I registered the ID "ajwR" for it. The creator ID is arbitrary. I just used my initials and "R" for "Rocketship".

The preferences APIs
Palm OS version 2 (and later) changed the names of the preferences APIs used by OS version 1. This was done so that programs would default to the newer APIs. If you don't change the function name to the new name, you'll build using the newer API. The problem with this is that if you use the newer APIs you'll crash on a Palm 1000 and 5000 (unless they've been upgraded, of course).

The newer APIs provide some additional functionality, so there's reason to use them, but you must be aware that the program is no longer compatible with the older Pilots.

In Rocketship, I use the the older APIs where I must, and the newer APIs if they're available. I'll explain that later.

Palm OS version 1
The original preferences APIs are available in all current PalmPilots from the Palm 1000 and 5000 through the Palm III.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
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 --

BLOGGING AND PODCASTING WITH ONE EASY-TO-USE TOOL
Now you can publish your thoughts, opinions, and comments in your own blog or podcast.<p />

  • Supports multiple authors and multiple blogs or podcasts.
  • Generate and publish RSS feeds for iTunes and other directories.
  • Post photos, images or animations.
  • Get feedback and have conversations with visitors to your site. <p />

Personalize your blog or podcast with your own unique domain name -- or integrate it with your existing site by setting it up as a subdomain.

Tap here and get blogging or podcasting within minutes.

-- Advertisement --

Sent Items Organizer
When you need to file your sent email into their proper folders based on keywords or who it's to. It's also perfect for shared mailboxes.

It also adds a "Send And File" toolbar button while you're composing (similar to the way Lotus Notes used to work) for quick and easy filing.

Find out more!

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