Bluetooth signal strength, anyone?

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

Trying to use the broadcastreceiver and then getting the signalstrength in the event but it does not work.

I try this:

Sub BroadcastReceiver_OnReceive (Action As String)
Dim Intent1 As Intent
Dim signal As String
Intent1.Initialize(Action, "")
signal = Intent1.GetExtra ("BluetoothDevice.EXTRA_RSSI")
ToastMessageShow(signal,False)
'can only abort when sendOrderedbroadcast is called.
Broadcast.AbortBroadcast
End Sub

I know for sure the device has the RSSI available because another app of another developer shows me the signal strength.

Cheers,
 

bluedude

Well-Known Member
Licensed User
Longtime User
Doing that

Hi,

I have implemented that library because it does the intent filter for me from within the code and I don't need to change the manifest:) Not sure how to get the data from the intent filter however. The broadcast is received but then I'm stuck.

Tried to find sample code for handling intent filter but there isn't any as far as I can see.

Cheers,
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Service start

So, when catching the broadcast do I need to start a custom service then and that service can get the info?

Or should this service run or something like that? Currently it is an activity. Can an activity do that?
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Shared the code

Ok, dropped the library and just added it to the manifest with a service to get the intent, now it works.

Cheers,
 
Upvote 0
Top