Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bluetooth connection without pairing

I was looking to find a method to connect two phones using bluetooth without having to first pair them. I am trying to omit the annoying bluetooth pop up request. There is an app on the google store that does this called Bluehood. I wanted to use that style of connection for an app I am building in a totally different niche. You can search for the app on the google store called "Bluehood Social Bluetooth". https://play.google.com/store/apps/details?id=com.mobile.bluehood

like image 242
Lockflower Avatar asked May 30 '14 00:05

Lockflower


1 Answers

You may create an insecure bluetooth serial connection between two devices.

To create a connection:

Identify the BluetoothDevice and call its method createInsecureRfcommSocketToServiceRecord

To receive a connection:

Get hold of BluetoothAdapter and call the method listenUsingInsecureRfcommWithServiceRecord

This technique won't require the devices to establish a connection using pairing code. Its available in API level 10 and above.

like image 77
waqaslam Avatar answered Sep 21 '22 13:09

waqaslam