Friday, November 21, 2008

Radio Paradise

I have yet another "radio player" app in the iTunes App store. It's called Radio Paradise and, as the name implies, allows listening to music from the Internet radio station, I've been a listener for years, so I asked the owner of the station for permission to make an official iPhone app for the station.

I also used the app as an opportunity to test out a few additional features. The app will detect the type of connection you have (either cellular or WiFi) and will automatically use either a 64K or 128K stream. I originally had buttons in the app to allow the user to select the stream quality, however Apple rejected that idea because it would be possible to a user to select a 128K stream over cellular and in Apple's judgement that consumed too much bandwidth. I could have restrict the choice when on a cellular network, but for now I just simplified it and the app makes the decision for you.

The second feature this app uses is the inclusion of album artwork for the current track playing. Radio Paradise embeds in the audio stream the URL for the current artwork. So, it was simply a matter of having my app fetch the image as the song is playing.

The third feature is the implementation of a mini web browser. This will allow the user to visit the Radio Paradise web site while still listening to the music. Apple doesn't allow third party apps from running in the background, so normally if you were to launch Safari, the radio player is forced to exit. The mini browser also includes a button to allow the user to launch Safari if they really want to.

This app took by far the longest yet for gaining Apple's approval. It was almost a month! The biggest issue I kept running into was Apple claiming my app didn't throw up a message box informing the user when there was no network. I kept testing it and it always worked for me. After about 4 re-submission attempts, I finally discovered Apple was testing using the 2.0 iPhone OS and I was testing with 2.1. (It sure would have been helpful had Apple actually told me what OS they were testing with. I even asked, but never got an answer.) It turns out the "reachability" flags returned are slightly different between 2.0 and 2.1. Once I finally discovered that issue the app was quickly approved ("quickly" in Apple-speak means a few days).

Oh, and check out the size of this app - all those features and it's only 130K! Yes, K! I put my code on a diet! (Actually, it's because Apple's libraries, or frameworks, do much of the work and the frameworks are already installed on the phone.)

All content copyright © 2009  Brian Stormont, unless otherwise noted.   All rights reserved.