简体   繁体   English

两部手机之间的接近检测 (Android)

[英]Proximity Detection Between Two Phones (Android)

I'm trying to figure out how I can send a notification to both phones when they reach a 6ft range from each other.我试图弄清楚如何在两部手机彼此相距 6 英尺时向它们发送通知。 I know that GPS is too wide of a range and so if wifi, I'm currently trying to use Bluetooth Low Energy because I heard it was more precise please let me know if there is any way I can go about this.我知道 GPS 的范围太广,所以如果 wifi,我目前正在尝试使用蓝牙低功耗,因为我听说它更精确,请让我知道是否有任何方法可以 go 关于这个

According to this blog , the signal range of each Bluetooth version varies.根据这篇博客,每个蓝牙版本的信号范围各不相同。 so it's difficult to find distance just by signal strength alone.因此仅凭信号强度很难找到距离。

Solution : The proximity between the two devices can only be known when they are connected, as soon as they are connected request the user to stand 6 feet away from the other user and note the signal strength.解决方案:两个设备之间的距离只有在它们连接时才能知道,一旦它们连接,就要求用户站在距离另一个用户 6 英尺的地方并注意信号强度。 note: it won't be accurate.注意:它不会是准确的。 it totally depends on the environment这完全取决于环境

Here is a thread to find the signal strength.是一个查找信号强度的线程。 Hope this helps希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM