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.

  • Android studio doesn't recognize the running emulator
  • Every WebKit-based browser crashes sites using Omniture. Why?
  • USB device access pop-up suppression?
  • Android onActivityResult is always 0
  • send intent from service to activity
  • Can't compress a recycled bitmap
  • 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.

    Related posts:

    Tests fail after Espresso 2 upgrade (failed: Instrumentation run failed due to 'java.lang.I...
    Multiple SearchRecentSuggestionsProvider classes in Android app possible?
    Android Support BottomSheetBehavior can't be dynamic?
    Android studio emulator fails to start with memory limit related error message
    Android Compatibility Library CursorLoader : java.lang.IllegalStateException: Cursor is closed
    My Android XML files can't find ActionBarSherlock themes
  • Finish activity after toast message disappears?
  • Method setDrawerListener is deprecated
  • EditText and MultiAutoCompleteTextView suggestions
  • SecurityException: caller uid XXXX is different than the authenticator's uid
  • Android SQLiteOpenHelper cannot open database file
  • Android Chrome custom tabs / Fitbit web API won't redirect if app is already authorized. (OAuth2.0)
  • 3 Solutions collect form web for “Distance between two android phones”

    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.

    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.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.