Android Question BT discovery returns >80 same device on Chuwi android 8.1

MbedAndroid

Well-Known Member
Licensed User
Longtime User
Using Erel's example of BT running it on the Chuwi, returns multiple same device. Around 80-100 it stops with the list found devices (all the same, all same MAC). Never seen this on any other device. Is this something new in android 8+?
code used for test/example
https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768

bluetooth device is a HC05, but that doesnt matter with this example. This problem comes up also with the app which was build for the gps


/#content
 

MbedAndroid

Well-Known Member
Licensed User
Longtime User
advertising? dont think so, those chuwi's without any bloatware.
Will check another android 8 device.
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
here the code with maps to solve this issue

B4X:
Private Sub Admin_DeviceFound (Name As String, MacAddress As String)
    Log(Name & ":" & MacAddress)
    If foundDevices.ContainsKey(MacAddress) Then
    Else
        foundDevices.Put(MacAddress, Name)
        ProgressDialogShow(ResourceStrings.Get("SEARCHDEVICE") & " (~ device found)...".Replace("~", foundDevices.Size))
    End If
End Sub
Sub Admin_DiscoveryFinished
    ProgressDialogHide

    Private i As Int
    If foundDevices.Size = 0 Then
        ToastMessageShow(ResourceStrings.Get("NODEVICE"), True)
    Else
        Dim l As List
        l.Initialize
        For i=0 To foundDevices.Size-1
                    l.Add(foundDevices.GetValueAt(i))
        Next
        InputListAsync(l, ResourceStrings.Get("DEVICECONNECT"), -1, True)
        Wait For InputList_Result (Index As Int)
        If Index <> DialogResponse.CANCEL Then
            ProgressDialogShow(ResourceStrings.Get("TRYCONNECT") & foundDevices.GetValueAt(Index) & " (" & foundDevices.GetkeyAt(Index) & ")")
            Serial1.Connect(foundDevices.GetkeyAt(Index))
        End If
    End If
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…