D doodooronron Member Licensed User Mar 24, 2021 #1 I haven't been able to find an example of how to scan and populate a tableview of available BLE devices from which I can select one to connect to. My attempt to do this is cobbled together from bits of code from the BLE Central and Tableview examples. The log shows that a device is found but it doesn't appear in the tableview. The "TableView1.AddSingleLine(Name)" command works when it's in the "Private Sub Application_Start (Nav As NavigationController)" subroutine, but not in the "DeviceFound" subroutine. If the manager.Connect(DeviceId) line is unmarked, the device which is found connects. B4X: Copy Private Sub Manager_DeviceFound (Name As String, DeviceId As String, AdvertisingData As Map, RSSI As Double) Log($"DeviceFound: ${Name}"$) TableView1.AddSingleLine(Name) ' manager.Connect(DeviceId) End Sub
I haven't been able to find an example of how to scan and populate a tableview of available BLE devices from which I can select one to connect to. My attempt to do this is cobbled together from bits of code from the BLE Central and Tableview examples. The log shows that a device is found but it doesn't appear in the tableview. The "TableView1.AddSingleLine(Name)" command works when it's in the "Private Sub Application_Start (Nav As NavigationController)" subroutine, but not in the "DeviceFound" subroutine. If the manager.Connect(DeviceId) line is unmarked, the device which is found connects. B4X: Copy Private Sub Manager_DeviceFound (Name As String, DeviceId As String, AdvertisingData As Map, RSSI As Double) Log($"DeviceFound: ${Name}"$) TableView1.AddSingleLine(Name) ' manager.Connect(DeviceId) End Sub
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2021 #2 Never a good reason to use TableView. Use xCustomListView instead. Upvote 0