Android Question Bluetooth rssi (signal strenth)

Arun Kumar Rajan

New Member
Licensed User
Hello friends, kindly help me to get bluetooth rssi (signal strenth). I am very new to b4a and tried with almost every tutorial about bluetooth rssi with broadcostreceiver library. But i cant get code work.

Please anyone help me

Thanks in advance
 

Erel

Administrator
Staff member
Licensed User
Add a service to your project (named Service1).

Add this code to the manifest editor:
B4X:
AddReceiverText(service1,
<intent-filter>
<action android:name="android.bluetooth.device.action.FOUND" />
</intent-filter>)
Service_Start will be called whenever a Bluetooth device is discovered:
B4X:
Sub Service_Start (StartingIntent As Intent)
   If StartingIntent.Action = "android.bluetooth.device.action.FOUND" Then
     Dim rssi As Int = StartingIntent.GetExtra("android.bluetooth.device.extra.RSSI")
     Log("rssi: " & rssi)
   End If
End Sub
Call BluetoothAdmin.StartDiscovery to search for devices.

You can see the list of fields here: http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#EXTRA_CLASS
 
Last edited:
Top