Logged in as Guest   Fri, Mar. 12th, 4:50 AM.      
Visitor Map
Recent Entries:
My Dev Setup Lately
Three Ways To Randomize on the iPhone
How to Remove .svn Directories On a Mac
How To Detect The iPhone Simulator
iPhoneMom Likes Doodle Games!
Updates To the Doodle Games Line
Three Jacks Now Tweets
Second iPhone App Submitted For Approval!
Pinch Media Analytics for iPhone
New iPhone Game Coming Soon!

Archive:
January - 2010
November - 2009
October - 2009
September - 2009
August - 2009
July - 2009
June - 2009
April - 2009
March - 2009
January - 2009
May - 2008
April - 2008
March - 2008
October - 2007
August - 2007
July - 2007
June - 2007
May - 2007
April - 2007
December - 2006
November - 2006
September - 2006
August - 2006
July - 2006
March - 2006
February - 2006
January - 2006
December - 2005
November - 2005
October - 2005
September - 2005
August - 2005
July - 2005
June - 2005
May - 2005
April - 2005
February - 2005
January - 2005
December - 2004
November - 2004
October - 2004
September - 2004
August - 2004
July - 2004
June - 2004
May - 2004
April - 2004
March - 2004

Documenting Wrongs (PalmOS)
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
Submitted by bosshogg on Tuesday the 27th of December 2005, at 04:11 pm


Unintended Consequences
About seven years ago I wrote some code to do Mu-Law and A-Law compression. About six years ago, I decided to publish an article along with the source code for it. You can find it here. Anyway, the other day I received an email from someone who had taken it and modified it for what he was doing. In doing so, he found a piece of misinformation that has been in my article since I originally published it. Not a big deal, and I intend to rectify the issue. However, as we chatted over email, I asked him what he was using Mu-Law/A-Law compression for. Here is a clip from our email:

> So if you don't mind me asking, what are you working on that has 13 bit
> unsigned audio input?

Sure. I am designing a system that monitors lots of radio stations to capture and
detect Emergency Alert System activations - those ugly tones and occasional
voice messages you hear on the radio. The system has some rather incredible
shortcomings for a critical system in 2005. When the emergency management
office triggers an alert they have no way of knowing whether or not radio stations
actually broadcast the alert. Sometimes the system fails - too often. So our
system listens to the stations and sends a report back to Emergency HQ. In
most cases an exception report that shows which stations did not properly
send out the alert. So if the dam is breaking or the nuke is going critical they
can try again, use the phone, send a helicopter or something.

Whoa. Code that I originally wrote to compress audio in children's games is now being used to help monitor Emergency situations. Talk about your unintended consequences!

-Jon
Submitted by bosshogg on Wednesday the 14th of December 2005, at 10:15 pm