distance between android and iphone

前端 未结 2 1223
[愿得一人]
[愿得一人] 2021-01-03 05:40

I am looking for a way to transmit data when two phones are close by. This needs to be cross platform so I cannot use NFC or iBeacon. I plan on using allJoyn to send informa

相关标签:
2条回答
  • 2021-01-03 06:06

    Shot in the dark answer:

    1. If both devices are on the same wireless WiFi network (same subnet), then any devices on same network are "close enough".

    2. When on the celluar network (or when only one device is on Wifi), use the Location APIs of the platform to get GPS coordinates. Send your coordinates up to a web server that keeps track of the Latitude/Longitude coordinates of each device. The web service also allows the devices to poll for nearby devices (where the distance equation can be computed on the server).

    0 讨论(0)
  • 2021-01-03 06:06

    So the best way that I found to do this is to use the accelerometer to tell when two devices bump then I get the bluetooth signal strength of the nearest device, if that falls into a certain value then they are touching.

    0 讨论(0)
提交回复
热议问题