Course Content

Course Content

Description

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().

Syntax :

private BluetoothAdapter BA;

BA=BluetoothAdapter.getDefaultAdapter();

In order to enable the Bluetooth of your device, call the intent with the following Bluetooth constant ACTION_REQUEST_ENABLE.

Syntax :

Intent turnOn=new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);

startActivityForResult(turnOn,0);

We have different Constants of Bluetooth Adapter Class such as ACTION_REQUEST_DISCOVERABLE, ACTION_STATE_CHANGED, and ACTION_FOUND.

FAQs

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download The Apps

Code Scan or Download the app
Google Play Store
297K+ Downloads
4.5 Rating
10K+ Reviews
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere