Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distance between two android phones

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.

like image 911
Keith Avatar asked Nov 26 '10 10:11

Keith


People also ask

How can I find the distance between two phones?

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.

How can I find the distance between two Bluetooth devices?

Using the Principle of Triangulation Unlike ranging, you can determine the distance separating Bluetooth devices by using the angle of incoming signals.

Can Android phones Measure distance?

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.

Can you connect two Android phones together?

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.


2 Answers

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?

like image 104
Robert Avatar answered Oct 15 '22 21:10

Robert


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.

like image 1
Pedro Guimaraes Avatar answered Oct 15 '22 20:10

Pedro Guimaraes