Detect Bluetooth API optional package (JSR 82)
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MMain extends MIDlet implements CommandListener
{
private Form form;
// Check if Bluetooth API optional package (JSR 82) is present.
public static boolean hasBluetoothAPI ()
{
try
{
Class.forName (”javax.bluetooth.LocalDevice”);
return true;
}
catch (Exception _ex)
{
return false;
}
}
// Return the Bluetooth API version of this device, null if API is not present…
public static String verBluetoothAPI ()
{
// Initialize return value…
String version = null;
// First [...]
RSS