Download the New LearnVern Android App and enter Lucky Draw to win Free Certificate
Bluetooth Adapter in Android
In this video we are going to learn Bluetooth adaptor in Android.
First of all when we want to work with Bluetooth adaptor we need to use its class. We need to perform basic operations like Initiate device discovery, Query a list of paired devices, Create a bluetooth server socket instance to listen for connection requests etc...
We can create an object of this calling by calling the static method getDefaultAdapter().
private BluetoothAdapter BA;
In order to enable the Bluetooth of your device, call the intent with the following Bluetooth constant ACTION_REQUEST_ENABLE.
Intent turnOn=new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
We have different Constants of Bluetooth Adapter Class such as ACTION_REQUEST_DISCOVERABLE, ACTION_STATE_CHANGED, and ACTION_FOUND.
Have a friend to whom you would want to share this course?