I'm wondering: other than GPS location, is there any way to find if two phones is within a certain distance from each other? For example, if one phone is under 3 feet from another one, as GPS is not that accurate.
I'm developing a multiplayer interactive game for my final year project on the android platform and it would require that one gamer is within 3 feet or less from another.
Anything at all is most helpful but from looking around it would seem that it's not really possible. Most phone data can be shared and I will be using both bluetooth and multicast sockets.
Thanks very much for your time.
Thanks to everyone so far for your replies. I'm still looking into this and will update when I find something alittle bit easier to do; but so far it would seem using bluetooth RSSI value is the way to go.
The 'WifiNanScan app lets you measure distance with a precision of about one metre with phones up to 15 metres apart. Google has launched a new WifiNanScan app for developers on the Google Play store. This app measures distance between two smartphones using the Wi-Fi Aware protocol.
Using the Principle of Triangulation Unlike ranging, you can determine the distance separating Bluetooth devices by using the angle of incoming signals.
Google's augmented reality app “Measure” turns ARCore-compatible Android smartphones into digital measuring tapes. Simply launch Measure, point the phone's camera to an object, then pick two points to measure the distance in between.
How do I connect two Android phones? Enable Bluetooth on both phones. Place one of your phones in “Discoverable Mode.” Find this option in the Bluetooth menu. Search for the phone using your other device.
No, Android devices do not contain such features. The best thing you can probably do is to measure bluetooth signal strength. It will not automatically give you a precise answer, but you could perhaps create a baseline in your application first. That is, click a button when the Android devices you are interested in are roughly 1 metre from each other.
See the following question: Android 2.1: How do I poll the RSSI value of an existing Bluetooth connection?
I also have the same need, and indeed GPS can't be used for such accuracy. My solution is more practical and envolves way less calculation. At the moment of the beginning of the game, you might "calibrate" the devices you want to interact with.
For instance, bring the two android devices together and press some calibration tool at the same time. Then, you will be considering that point in space the (0,0,0) coordinate for both devices.
Using Accelerometer and Gyroscope, basically, and maybe other sensors, you can do the trick. Hope it helps, cause it is the solution I'm about to implement right now. Gonna take a peek at that bluetooth RSSI stuff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With