2

I have read many, many SO questions and answers about this topic but none seem to work completely. The 3 most detailed answers I have found are:

Using the Android RecognizerIntent with a bluetooth headset

Programmtically connect to bluetooth headset from android app

bluetooth pair and connect device
Which references : https://github.com/giladHaimov/BTWiz

all of which are now quite old and have had no further discussion in some time.

and the Bluetooth chat example from the sdk. - compiles and works as a text chat example, but after modification I can not get it to create a connection to any headsets.

I have followed the above 3 examples and worked through the code and customized them to my application - adding extra variable references as required. Most if not all examples seem have major errors and are only pointers. I am not asking for "you email me complete working code", but there is enough missing from all the answer that the missing part can not be felt in the dark.

I have also downloaded the HSP and HFP and SPP and RFCOMM Bluetooth specifications docs. These are even more vague. They say "create a connection".. but don't indicate how... I understand they are trying to be OS/language agnostic... but ouch!!

I am able to get as far as a broadcast receiver or listener acknowledging the creation of a new connection, but there seems to be a gap between that point and getting a functional SCO audio connection.

After creation of the connection, looking at the built in BT manager app, the headset doesn't show as connected at all.. so this must be a low level connect (ACL) and not a high level connection.

I understand that each persons approach to programming a solution is different, but the underlying issue remains the same. Some are low level and close to the OS, others have a high degree of abstraction and referencing high level objects which perform the low level work.

Is anyone able to shed some light on the necessary steps to get from an ACL connection to a functional audio connection please?

I can post code examples later if requested.

Community
  • 1
  • 1
Linzmeister
  • 21
  • 1
  • 3

0 Answers0