Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

android - 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...