Configuring Presets Automatically
A useful function that radio applications can provide is the ability to automatically configure radio tuner presets. The reasons for doing so range from autosetting for user convenience in a given location, to a sophisticated marketing mechanism for promoting affiliated radio stations as listeners roam from state to state or country to country.
To begin with, the application needs to know how many preset channels are available on the mobile phone. This number varies from five to ten or more, and can be ascertained from TunerControl's getNumberOfPresets() method:
int NumberOfPresets = tunerControl. getNumberOfPresets();
To preset a channel, you must have the radio station's various turning and interaction information. These data can be stored offline and locally on the phone, or obtained on-line/over-the-air via a wireless data network service, such as the General Packet Radio Service (GPRS).
Online Radio Station Database
For online query of the radio station's preset data, the radio application can prompt users for their geographical location via a text entry, or provide a list of likely locations. Better yet, the radio application can directly read the user's GPS coordinates via the JSR-179 Location API (www.ddj.com/ documents/s=9938/ddj0601i/0601i.html). Both of these approaches enable a database server to determine the location of listeners and return a list of radio stations with coverage in that area. In other words, this would be like "GSM roaming," except that it is "radio station roaming." The radio application will then replace and update the static (and most likely out-of-range) radio presets with radio station names and frequencies receivable and valid for the area that listeners are currently at.
For instance, assume users have just arrived at a new area where the available radio stations are:
- KAAAA, an independent network operating at 97.0 MHz on the FM dial.
- KBBBB, a KEEEE affiliate operating at 104.6 MHz FM.
- KCCCC, a KFFFF affiliate broadcasting at 110.5 MHz FM.
If it was a purely utilitarian application, the radio application could simply update the preset in a sequential manner, using radio stations it encounters as it scans the spectrum from the lowest to the highest frequency. For example, if the tuner picks up the first station at 97.0 MHz and there is an entry for 97.0 MHz on the server's list, the application will set Preset 1 to 97.0 MHz with the corresponding radio station name indicated in the list ("KAAAA"), and so on.
If the radio application was sponsored or provided by a radio-station network, the server's database list could include only affiliated radio stations. Because the radio stations on 97.0 MHz and 104.6 MHz are not affiliates of the network "KFFFF," the sponsored application skips to the next station until it finds a station with a matching frequency that is an affiliate of the radio network. On the listener's phone, the preset eventually becomes Preset 1 at 110.5 MHz and the corresponding radio station name becomes "KCCCC."