Kevin Zhou
Kevin Zhou

Reputation: 1283

Android App Bluetooth Determining distance between paired devices

so I'm trying my hand at android developing this summer. I was trying to make a sort of alarm app when a pair of connected devices go out of range of each other.

From looking around on the internet / stack overflow, it seems that looking at the RSSI value will help me achieve this.

However, it seems that the RSSI value can only be read at the time of connection with the device, that is it doesn't update itself (or there is no method to do so).

  1. Is the RSSI value the only way to achieve my goal?
  2. Would it be possible to use RemoteDevice and RemoteDeviceHelper? Has anyone tried this?
  3. Any other suggestions and hints would be much appreciated

Upvotes: 2

Views: 2925

Answers (1)

Dennis Mathews
Dennis Mathews

Reputation: 6975

You could establish a connection with the device and exchange heartbeat information with the device , you can use the reception of valid heartbeat information to detect device being in range and or going out of range.. Your algorithm can use this information in conjunction with the connection loss to detect device being out of range and set off the alarm.

RSSI in Android available via public APIs is only during the discovery process, the other non public means of reading the RSSI (like in RemoteDeviceHelper) should also be possible , but RSSI by itself is not a good indication of distance.

Upvotes: 2

Related Questions