Enhancing Listener Interaction
To increase listener interaction with radio stations, a quick-launch interaction shortcut can be included in radio applications. For instance, instead of having to remember a radio station's call-in number, exiting the radio application, then keying in the number to call the radio station, you can configure a phone button for automatic dialing of call-in numbers at the radio station listeners are tuned to:
if (c == CMD_CALLSTATION) { ... if (tunerControl.getFrequency()== 911000) platformRequest("tel:5559110"); ... }
Similarly, a shortcut for sending SMS "votes" or song requests can be incorporated using the Wireless Messaging API (WMA). This saves users from having to remember SMS codes and formats to key in, as well as SMS numbers to send messages to. In this instance, the radio application has an internal record of that information as well as the radio station's SMS message templates:
if (c == CMD_MESSAGESTATION) { ... if (tunerControl.getFrequency()==9 11000) { ... textMessage.setPayloadText ("vote " + choice); ... } ... }
Tuner and Station Presets
The preset stations of the mobile phone's native radio tuner application can be set using TunerControl's setPreset() method. The required attributes are the preset number, radio frequency in units of 100 Hertz, AM/FM modulation, and stereo mode for the station. For instance, to preset channel 1 for an FM stereo radio station whose frequency is 91.1 MHz (where 911,000 = 91.1 MHz × 10,000):
tunerControl.setPreset(1, 911000, TunerControl.MODULATION_FM, TunerControl.STEREO);
On a new mobile phone just out of the box, you can assume that none of the radio presets are configured. However, if a phone has been in use, users may have manually configured one or more of the presets. Consequently, it is a good idea to ask/confirm with users before overwriting the presets.
To tune to radio stations in the preset list, simply call TunerControl's usePreset() method with the channel number of the preset:
tunerControl.usePreset(1);
However, if some presets are not set, users may end up hearing static when they tune in to a frequency with no broadcast. To mute those channels, use TunerControl's setSquelch() method with the Boolean parameter true:
tunerControl.setSquelch(true);