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.