STWBluetooth Manager
STWBluetoothManager
Description :
This class represent the API for all actions/event related to Bluetooth.
Example of use :
- Implementation :
STWBluetoothManager.getInstance().registerForBluetoothManagerEvents(context,
private BluetoothManagerListener mBluetoothManagerListener = new BluetoothManagerListener() {
public void onBluetoothAudioScoStateChanged() {
//code
}
public void onBluetoothConnexionStatusChanged(boolean isConnected) {
// code
}
public void onCheckExistConnectedDevice() {
// if you use our module "swhardware" you can call the public method
// STWBLEManager.getInstance().checkConnectedDevices(context);
}
public BluetoothDevice getCurrentBluetoothDeviceConnected(){
// if you use our module "swhardware" you can call the public method
// return STWBluetoothClassicManager.getInstance().getCurrentBluetoothDeviceConnected(address)
}
});
Content copied to clipboard - Unregister :
STWBluetoothManager.getInstance().unregisterForBluetoothManagerEvents(mBluetoothManagerListener);
Content copied to clipboard
Content copied to clipboardContent copied to clipboard
Functions
Link copied to clipboard
Get or create the single instance of STWBluetoothManager.
Link copied to clipboard
open fun registerForBluetoothManagerEvents(@NonNull bluetoothManagerListener: BluetoothManagerListener)
Content copied to clipboard
Register the specified listener to be notified by any Bluetooth event
Link copied to clipboard
open fun unregisterForBluetoothManagerEvents(@NonNull bluetoothManagerListener: BluetoothManagerListener)
Content copied to clipboard
Unregister the specified listener to not receive any Bluetooth events