Package com.medm.devicekit
Class BluetoothState
- java.lang.Object
-
- com.medm.devicekit.BluetoothState
-
public class BluetoothState extends java.lang.Object
BluetoothState allows you to listen the current bluetooth state
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BluetoothState.Listener
static interface
BluetoothState.TurnOnListener
static class
BluetoothState.Value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(BluetoothState.Listener listener)
BluetoothState.Value
getValue()
boolean
hasPermissionsToTurnOnBluetooth(android.content.Context context)
void
onBluetoothTurnedOn(BluetoothState.TurnOnListener listener)
Wait until the first turn on event happens and unsubscribe the listener.void
removeListener(BluetoothState.Listener listener)
-
-
-
Method Detail
-
hasPermissionsToTurnOnBluetooth
public boolean hasPermissionsToTurnOnBluetooth(android.content.Context context)
-
getValue
public BluetoothState.Value getValue()
-
onBluetoothTurnedOn
public void onBluetoothTurnedOn(BluetoothState.TurnOnListener listener)
Wait until the first turn on event happens and unsubscribe the listener. Convenience method when you want to use lambda and not care about unregistering the listener.
-
addListener
public void addListener(BluetoothState.Listener listener)
-
removeListener
public void removeListener(BluetoothState.Listener listener)
-
-