Android Question Bluetooth rssi (signal strenth)

Discussion in 'Android Questions' started by Arun Kumar Rajan, Jul 19, 2014.

  1. Arun Kumar Rajan

    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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Add a service to your project (named Service1).

    Add this code to the manifest editor:
    Code:
    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:
    Code:
    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: Jul 20, 2014
    Azam Memon and Arun Kumar Rajan like this.
  3. Arun Kumar Rajan

    Arun Kumar Rajan New Member Licensed User

    Thank you friend, Now my code working....
    Thanks lot.
     
  4. techknight

    techknight Well-Known Member Licensed User

    How do I match this up to a particular device? How would I know?
     
  5. DonManfred

    DonManfred Expert Licensed User

    This is an OLD thread!!!!
     
  6. techknight

    techknight Well-Known Member Licensed User

    Yes, but still relevant on what I am looking to achieve.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    You should start a new thread with your question and post a link to this one.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice