Course Content

Course Content

Bluetooth Adapter in Android

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 LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
297K+ Downloads
App Download Section Circle 1
4.5 Rating
App Download Section Circle 2
10K+ Reviews
App Download Section Circle 3
  • 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