danger.bluetooth
Class Bluetooth

java.lang.Object
  extended by danger.bluetooth.Bluetooth


public class Bluetooth
extends Object

Since:
3.0

Method Summary
static String getAddress()
          EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Return the address of this device.
static boolean isOn()
          EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Return the current on/off status of the Bluetooth radio
static void registerBluetoothEventsListener(Listener listener)
          EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Register for Bluetooth events Calling this will cause Bluetooth events to be sent to the listener.
static boolean requestOn(Event notifyEvent)
          EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Turn bluetooth on with the user's permission.
static void showDeviceSelectionDialog(String title, String hint, Event selectedEvent)
          EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Display the device selection dialog to allow the user to select a device.
static void showPairingDialog()
          EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Display the pairing dialog to allow the user to pair with a device.
static void unregisterBluetoothEventsListener(Listener listener)
          EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Unregister for Bluetooth events Calling this will unregister a previously registered listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isOn

public static boolean isOn()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.
Return the current on/off status of the Bluetooth radio

Returns:
boolean whether the radio is on or off

requestOn

public static boolean requestOn(Event notifyEvent)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.
Turn bluetooth on with the user's permission. If bluetooth is already on, true will be returned. If bluetooth is off, false will be returned, and the specified event will be sent after asking the user and taking any appropriate action.

Returns:
true if bluetooth already on, false otherwise
Since:
4.5

getAddress

public static String getAddress()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.
Return the address of this device.

Returns:
String The string representation of the bluetooth address for this device.

registerBluetoothEventsListener

public static void registerBluetoothEventsListener(Listener listener)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.
Register for Bluetooth events Calling this will cause Bluetooth events to be sent to the listener. The events are listed below. The current state will be sent when you make this call. EventType.EVENT_BLUETOOTH_STATE_CHANGED EventType.WHAT_BLUETOOTH_OFF EventType.WHAT_BLUETOOTH_ON

Parameters:
listener - The listener the events will be sent to.

unregisterBluetoothEventsListener

public static void unregisterBluetoothEventsListener(Listener listener)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.
Unregister for Bluetooth events Calling this will unregister a previously registered listener. The events are listed below. EventType.EVENT_BLUETOOTH_STATE_CHANGED EventType.WHAT_BLUETOOTH_OFF EventType.WHAT_BLUETOOTH_ON

Parameters:
listener - The listener to be unregistered.

showDeviceSelectionDialog

public static void showDeviceSelectionDialog(String title,
                                             String hint,
                                             Event selectedEvent)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.
Display the device selection dialog to allow the user to select a device. If a device is selected, the specified event will be sent. If no device is selected and the user closes the selection dialog, nothing will be sent.

Since:
4.5

showPairingDialog

public static void showPairingDialog()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.
Display the pairing dialog to allow the user to pair with a device.