One of the purposes for me having this blog is that I use it as a personal reference for quirks and oddities that I find while developing for PDAs and Smartphones. When I find something, I'll write a short blog about it. Then, later, when I'm trying to remember how to do something, I can actually search for it on the blog. This is one of those times.
So, I'm working on a little utility for my Treo 650 that has to know when an incoming phone call arrives. Now, I've worked with these APIs before (as I've documented in other posts here) and I thought that I knew how to be notified when a call comes in. It should be pretty simple; you have to 1. Load/Open the phone library, 2. Call PhnLibRegister, and then 3. Check for the phnLibLaunchCmdEvent in your PilotMain.
I sat down one evening and quickly wrote the code to do it. It all went pretty smoothly until I actually went to run it. According to my asserts and debug statements, everything loaded and registered correctly, but for some reason, I wasn't receiving any notifications.
Naturally I went to the web. I Googled everything I could. I looked in the PalmOS newsgroup archives. I looked in the Palm Inc. developer site. I looked in the sample code put out by both PalmOS and Palm. I couldn't figure it out. I was doing everything that they were. Why wasn't mine working? I struggled to rework the tiny bit of code in numerous different ways, all to no avail. Finally, through persistence and thanks to the magic of Google, I found
this bizarre chat transcript that (in a round-about way) describes how the value for phnLibLaunchCmdEvent used to be '2bad'. According to the transcript, it had to be changed from '2bad' to 'abad' because '2bad' isn't a valid value according to the PalmOS rules for custom launch codes. Weird.
I went and looked at the value defined for it in my header files and sure enough, it was '2bad'. Apparently, I have a very old version of the Handspring SDK. Ugh. If I had gone with a clean install of the SDK from Palm's site, I would not have run into this. So, now that I have a valid value, I'm up and running. However, I do have a question if anyone knows: "Are there any Treo devices that actually use the value '2bad' for phnLibLaunchCmdEvent?" Since my only reference is that weird chat transcript, I would love to know the full history behind it. Ok, back to my code now.
-Jon
|