Android Question HC 05 Classic Bluetooth : does not communicate with Android 12

Brian Dean

Well-Known Member
Licensed User
Longtime User
Android 12 will communicate with an HC-05 just like previous Android versions. Your problem is somewhere else.
 
Upvote 0

emexes

Expert
Licensed User
Hello people, take the example of 'Erel' To test with a Samsung Android 12 device, but it does not connect with the device, however with other devices such as a ZTE Android 9, is there any update of any library related to this demo?

This is the link :

https://www.b4x.com/android/forum/threads/hc-05-classic-bluetooth.66677/#content

I enjoyed the succinctness of the previous reply, and he's probably correct, so perhaps:

You might be better asking if anybody has gotten that demo working under Android 12, and what versions of libraries were used.
 
Upvote 0
This part of the code is never activated...

Private Sub admin_DeviceFound (Name As String, MacAddress As String)
Log($"Device found: ${Name}"$)
If Name = "CONTROLBT" Then'"HC-05" Then
Log("Trying to connect...")
admin.CancelDiscovery
serial.Connect(MacAddress)
End If
End Sub
 
Upvote 0
I was able to connect this way...

Public Sub Connect
'admin.StartDiscovery
serial.Connect("00:20:12:08:81:BC")
connecting = True
CallSub(Main, "SetState")
End Sub

Private Sub admin_DeviceFound (Name As String, MacAddress As String)
Log($"Device found: ${Name}"$)
If Name = "CONTROLBT" Then'"HC-05" Then
Log("Trying to connect...")
admin.CancelDiscovery
serial.Connect(MacAddress)
End If
End Sub

I communicate directly with the MAC, the problem is that if the device is another, how do I connect, I would have to know the MAC before...
 
Upvote 0
I solved it in the following way, Generate a list with the paired devices and select the one I want, in that list I show the MAC and with that I can select the one I want to work with, it works ok
 
Upvote 0
Top