0

I have seen several questions about this topic but none are answered, complete, or actually have answers "to the question asked".

I have a phone which has bluetooth tethering turned on and a tablet which is paired with the phone. Problem is that to get the connections started I must open the bluetooth menu on the tablet and click on the phone's name to actually connect. I would like to have my custom app which runs on the tablet emulate this button click programmatically.

Many online suggestions require creating a socket; however, I do not want to transfer my own data. I only want to "connect" to the device using whatever the default android interface is. (Unknown to me)

I suspect there must be some kind of intent that can be sent to trigger this connection but can't find it.

Russell Trahan
  • 783
  • 4
  • 34

1 Answers1

0

Currently android has not exposed the classes inorder to connect to Bluetooth PAN profile. Only HEADSET, HANDSFREE and A2DP classes are exposed to interact with them. However, you can dig into the bluetooth framework and identify the classes for PAN profile and use reflection to acheive this. This approach may fail and not guranteed to work as expected.

Refer more in the official documentation

Refer more on accessing Bluetooth classes using Reflection

Enable Bluetooth tethering programmatically

Community
  • 1
  • 1
siva
  • 1,850
  • 13
  • 14