19

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.

Josh
  • 10,961
  • 11
  • 65
  • 108
Keith
  • 420
  • 2
  • 5
  • 12
  • 1
    +1 for interesting question. But I'm curious, is GPS advanced enough to be this precise? (at least in droid devices anyway). – Jimmy Nov 26 '10 at 11:24
  • No its not that accurate as far as I know.3 to 5 feet maybe outdoors. also gps accuracy is variable so it would not be reliable enought. – Keith Nov 27 '10 at 00:46
  • Firstly I do not want to answer my own question because the solution I choose does not exactly achieve my goal. I decided to leave a comment, just to state that I do check this question but so far theres is actually no definite solution. – Keith Jun 24 '13 at 11:20
  • I decided to use a threaded zero crossings algorithm to monitor for two frequency ranges which were about 50 Hz apart. Now this has disadvantages including possible interference, sound which is counter productive to my game and the same frequency may be interpreted +/- 30 - 40 Hz so it requires a larger window for acceptable frequencies. The advantages are it was reasonably easy to implement, higher frequencies reduced the chance of misinterpretation in a crowded area and it is not all that intensive a process. – Keith Jun 24 '13 at 11:31
  • Great question, as I am doing something similar. I will however experiment with the GPS service offered by google which supposedly can get you pretty close, I read some where that when using the Google Maps it is projecting you within 4 meters and this is how you fit in the lanes on the map. for the purpose of your project it won't work, unless google has improved. For anyone else interested I'll let them know how it works out. – JenniferG Jan 15 '16 at 10:15

3 Answers3

3

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?

Community
  • 1
  • 1
Robert
  • 6,855
  • 4
  • 35
  • 43
1

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.

Romain Guidoux
  • 2,943
  • 4
  • 28
  • 48
0

Could you not have one device play some audio then the other calculate the delay in hearing that audio? Failing that, Vibration and Accelerometer with the same sort of principle but look for strength, based upon some known baselines.

rosstheboss
  • 151
  • 4
  • Using audio is the only solution I have yet come upon. I will play a frequency on one device while the other device is using a zero crossing method (Which still requires some refining) to monitor the micorophone data in real time. If I get it functioning properly I will post a full answer to my question. – Keith Mar 08 '11 at 20:08