11-19-2011 09:22 PM - edited 11-19-2011 09:23 PM
As noted with 7.1 API http://supportforums.blackberry.com/t5/Java-Develo
FM Radio API is available and says "to manipulate FM tuner settings on BlackBerry smartphones with supporting hardware." I imagine they wouldn't says this if no java-running BlackBerry handsets didn't have the hardware to support FM Radio.
I wanted to see if using Java microedition TunerControl that's been out since OS 5 would work: http://www.blackberry.com/developers/docs/5.0.0api
I tested on my 9780 running OS 6.0 and others tested on 9900 running OS 7.0 and we couldn't get it to work. We all used headsets with wires too.
Would someone post which handsets support FM Radio, please?
Does anyone see any problems with my code?:
int freqtext = Integer.parseInt(freqfield.getText());
try {
Player play = Manager.createPlayer("capture://radio");
play.realize();
TunerControl tunercnt = (TunerControl) play.getControl("TunerControl");
// play.prefetch();
tunercnt.setFrequency(freqtext, TunerControl.MODULATION_FM);
play.start();
} catch (MediaException me){
} catch (IOException ioe){
}
freqfield is where the user enters the FM frequency in 100 hertz.
11-22-2011 11:29 AM
There have been no announcements to date about devices that include and support FM tuners. You will need to wait for more information to be released before any actual testing can commence.
Note that *only* devices running OS 7.1 or higher will allow programmatic access to the FM tuner (if equipped).
Be sure to watch the Developer Blog for more information on this as it gets released:
Regards,