Android和iPhone之间的距离距离、Android、iPhone

2023-09-05 08:38:58 作者:怎扰i

我要寻找一种方式来传输数据时,两部手机都在附近。这必须是跨平台​​的,所以我不能使用NFC或iBeacon。我打算使用allJoyn发送信息。我只想将数据发送给其他人,在相隔数英尺我说。

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 information. I would only like to send data to others that are within a few feet of me.

有没有什么办法,我能得到距离对其他手机精确的读数?或者,我可以得到一个主设备,可以放置在房间的准确距离是多少?

Is there any way that I could get an accurate reading of distance on other phones? Or can I get an accurate distance on a master device that could be placed in the room?

推荐答案

所以,我发现做到这一点的最好方法是使用加速度计来告诉当两个设备磕碰然后我得到的最接近设备的蓝牙信号强度,如果落入一定的值,那么他们是感人。

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.