How to get each device's distance from bluetooth?

27
April 15, 2019, at 7:40 PM

I have a module device (Galaxy S2, API 16) and this device is use to be server module.

and I need a distance of between server device and client device.

TRY 1. I tried use RSSI value to get distance. (use BroadCastReceiver, android.bluetooth.device.action.found and EXTRA_RSSI)

but it works only for unpaired devices, and need allow always bluetooth search mode.

i think my client doesn't like it that i can't use that.

TRY 2. I tried use BluetoothGattServer - readRemoteRSSI().

but gatt server required API 18, my server module is 16. I couldn't use that.

TRY 3. I connected server and client (Classic Bluetooth) for data communication.

I think some data packet will be loss by distance. (and i guessed data loss = distance)

but, RFCOMM was perfect. data is completely receive and send in bluetooth range.

i think that reason is RFCOMM similar to TCP PROTOCOL. (just in my guess)

and then i tried use to L2CAP protocol. (cause is similar to UDP. and i guessed it will be make a packet loss.)

but, android doesn't supply L2CAP protocol.

what can i do for get distance?

p.s) sorry for my english. thanks to read.

READ ALSO
Is there a way to automate user interaction with an android app?

Is there a way to automate user interaction with an android app?

I want to develop an app which can simulate user interaction on a web siteFor example the user types in a username and a password and a text

52
Swipe Layout automatically Swipe in first time when user open the Screen

Swipe Layout automatically Swipe in first time when user open the Screen

I'm creating a swipe layout using recyclerview, now I want to do something like gmail appWhen user open first time that screen the swipe layout automatically Swipe for interaction

18
How to fix this error whenever I am trying to run my android project?

How to fix this error whenever I am trying to run my android project?

Whenever I am trying to run my android project I get this error

58
Where is the CMake install option in Android Studio 3.2.1?

Where is the CMake install option in Android Studio 3.2.1?

I am trying to install NDK in Android Studio 32

38