是否有可能找到附近的其他电话? [英] Is it possible to find other nearby phones?

查看:125
本文介绍了是否有可能找到附近的其他电话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Android应用程序,我希望最终移植到iOS和Windows Mobile(尽管我现在对它们一无所知)。我希望我的应用程序能够在某个半径(也许20-30英尺)范围内找到其他手机,这些手机还安装了游戏,以便用户可以在当前物理空间中与其他人进行交互。这是可能的,如果是这样,如何?



我计划在应用程序中需要互联网连接,所以我的第一个想法是使用GPS,如iOS查找其他附近的设备(GPS位置),但这将需要不断传输数据到服务器使用带宽和电池更新用户的位置(更不用说服务器资源)。全球定位系统似乎也需要一段时间才能得到任何准确的解决方案,即使我不存储历史数据,我也不希望用户信任我那种私人信息(以及他们不应该这样做) / p>

我知道有些专有技术,比如索尼的NFC,但是这对于我希望成为设备和操作系统不可知的应用来说太狭窄了。还有什么其他选择?假设用户愿意为应用程序提供适当的权限,那么其他方法可以允许一个设备在10-15米范围内找到附近的另一个设备,这对于大型(百万以上)用户群是实用的? HTML5地理定位是一条更好的路径吗?或者,GPS是我唯一真正的选择?



我确实发现使用Android GPS检测并与其他手机进行连接,但希望在过去几年里开辟了更多选择。



更新



感谢您所有回覆。要回答评论和答案中提出的一些问题,我想我会描述我如何期待应用/设备进行交互。



所有安装此应用的用户都将拥有一个在后台运行的代理来更新他们当前的地理位置并监听ping。任何用户都可以打开完整的程序并向附近的所有其他用户发送快速请求。如果我转到中央服务器路由,则服务器会用附近的用户名列表响应该请求。然后,用户可以选择其中一个来启动连接,在这种情况下,目标设备会发出声音通知连接请求。



从这里开始,它很容易处理两个设备之间的交互。寻找附近的用户是我的关键。

解决方案

我可以看到的选项




  1. 蓝牙(BT)。我不知道,如果我不太怀疑它,但我看到几个问题。短距离。最大的能源消耗。最多同时连接7个对等点(但可能已经足够了......)。最大的优势是很多设备都支持BT。

  2. BB LE (低能耗)。好吧,它有助于能源消耗问题。但是,需要安卓4.3。 WiFi Direct (又名P2P)我给了它一个镜头,我有点失望。问题是它需要Android 4.0或更高版本。更糟的是,有些设备没有所需的硬件。我在Samsung Xperia Miro ST23i的Android样本上推出了 WiFiDirectDemo 。点击搜索,我唯一得到的东西是在您的设置中启用WiFi P2P - 。我点击了该设置中的所有内容,只有普通的WiFi和其他内容,没有提及Direct或P2P。 Xperio Miro不支持WiFi Direct。 使用互联网+设备地理位置与服务器进行WiFi连接。用户并回答诸如我的范围内20英尺是谁的问题。问题可能是地理位置的精确度。如果墙壁很厚或者您在地球上有少量卫星的地方 - 这可能是非常不准确的。



总结



有人更有可能会比WiFi更频繁地开启WiFi。英国电信也有一段时间后关闭(他们这样做可能会节省电池)。所以,WiFi似乎是比BT更好的选择。



如果WiFi Direct对您来说足够流行 - 我会试试看。如果没有,选项4似乎是最好的。我知道这并不理想,但在这一点上很难找到更好的东西(我们仍然需要技术开发,WiFi Direct看起来很有前景)。

I'm writing an Android app that I would like to eventually port to iOS and Windows Mobile (though I know absolutely nothing about them right now). I'd like my app to be able to find other phones within a certain radius (maybe 20-30 feet) that also have the game installed so that the users can interact with others in their current physical space. Is this possible and, if so, how?

I plan on the app requiring an internet connection so my first thought was to use GPS like described at iOS Find Other Nearby Devices (GPS locations), but that would require continually transmitting data to the server to update the user's location using both bandwidth and battery (not to mention the server resources). GPS also seems to take a while to get any sort of accurate fix, and even though I wouldn't store historical data I wouldn't expect users to trust me with that sort of private information (as well they shouldn't!)

I know there are proprietary technologies, such as Sony's NFC, but that's far too narrow a focus to use for an app that I'd like to be device and OS agnostic. What other options are there? Assuming the user is willing to give the app the appropriate permissions, what other methods could allow one device to find another nearby one, within a 10-15 meter range, that is practical for a large (million+) userbase? Is HTML5 Geolocation a better path? Or is GPS my only real option?

I did find Use Android GPS to detect and connect with other phones, but was hoping the past few years have opened up further options.

UPDATE

Thank you for all the responses so far. To answer some questions posed in the comments and answers, I thought I'd describe how I expect the apps/devices to interact.

All users who install this app will have an agent running in the background to update their current geolocation and to listen for pings. Any user may open the full program and send a quick request for all other users nearby. If I go the central server route, then the server responds to that request with a list of nearby usernames. The user can then pick one of those to initiate a connection, in which case the target device makes a sound to notify of a request to connect.

From there it's easy enough to handle the interaction between two devices. Finding those nearby users is the sticking point for me.

解决方案

Options I can see

  1. Bluetooth (BT). I don't know, if I'm not too skeptical about it, but I see couple of problems. Short range. The biggest energy consumption. Maximum 7 peers connected at the same time (but maybe it's enough...). The big advantage is that a lot of devices support BT.

  2. BT LE (low energy). Ok, it helps energy consumption problem. But, requires Android 4.3.

  3. WiFi Direct (aka P2P). I gave it a shot, I'm a bit dissapointed. The problem is that it needs Android 4.0 or higher. Even worse, some devices don't have required hardware. I launched WiFiDirectDemo from Android samples on Samsung Xperia Miro ST23i. Clicked on "search" and the only thing I got was a toast "enable WiFi P2P - in your settings". I clicked on everything in that settings, there is just normal WiFi and other stuff, no mention about Direct or P2P. Xperio Miro just doesn't support WiFi Direct.

  4. WiFi connection with a server through internet + device geolocation. Server keeps positions of users and answers questions like "who is 20 feet in my range?". The problem can be the precision of geolocation. If the walls are thick or you are in a place on earth with few satellites - it can be very inaccurate.

To sum up

There is greater probability that somebody will have WiFi turned on all the time than BT. BT also have some time limits after which it is turned off (they make it this way to probably save battery). So, WiFi seems a better choice than BT.

If WiFi Direct is popular enough for you - I would give it a try. If not, option number 4 seems the best. It's not ideal, I know, but at this point it's hard to come with something better (we still need technology development, WiFi Direct looks promising).

这篇关于是否有可能找到附近的其他电话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆