public final class RadioDevice
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BLUETOOTH |
static int |
BLUETOOTH_STATE_DISCOVERABLE |
static int |
PHONE |
static int |
RADIO_STATE_DISABLED |
static int |
RADIO_STATE_ENABLED |
static int |
WIFI |
Modifier and Type | Method and Description |
---|---|
static int |
getState(int type)
Retrieves the current state of the provided radio.
Currently works only on Android. Always return RADIO_STATE_DISABLED on other platforms. |
static boolean |
isSupported(int type)
Determines if the provided radio type is supported by the device.
Fully functional on Android devices. Always return false on other platforms. |
static void |
setState(int type,
int state)
Change the state of the provided radio.
Fully functional only on Android devices. Does nothing on other platforms. |
public static final int WIFI
public static final int PHONE
public static final int BLUETOOTH
public static final int RADIO_STATE_DISABLED
public static final int RADIO_STATE_ENABLED
public static final int BLUETOOTH_STATE_DISCOVERABLE
public static boolean isSupported(int type) throws java.lang.IllegalArgumentException
type
- The radio type to check for support.java.lang.IllegalArgumentException
public static int getState(int type) throws java.lang.IllegalArgumentException
type
- The radio type to have its state returned.java.lang.IllegalArgumentException
public static void setState(int type, int state) throws java.lang.IllegalArgumentException
type
- The radio type to have its state changed.state
- The new state for the given radio type.java.lang.IllegalArgumentException