采用Android GPS检测到跟其他手机 [英] Use Android GPS to detect and connect with other phones

查看:118
本文介绍了采用Android GPS检测到跟其他手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我问昨天类似的东西,并没有得到答复我的问题,但我真的不认为我没有问它,因此没有得到我所需要的确切信息。

So I asked something similar yesterday and did receive an answer to my question, however I don't really think I asked it correctly and therefore didn't receive the exact information I needed.

我在搜索的API,一些开源$ C ​​$ C,甚至只是一种方式,别人已经在Android取得了这一点。我在做一个应用程序,需要找到一个指定范围内的所有其他Android设备。例如,当你打开你的Andr​​oid谷歌地图应用程序,你搜索说餐厅[邮编code],它使用从您的邮递code修改半径,发现所有的地方。全球定位系统获取您的位置,地图使用该信息来查找地址接近的位置,通过中餐馆。

I'm in search of an API, some open source code, or even just a way that someone else has achieved this on the Android. I'm making an app that needs to find all other Android devices within a specified radius. For example, when you open your Android Google Maps App, and you search for say "Restaurants [ZipCode]", it uses a radius modified from your zip code and finds all of those places. The GPS gets YOUR location, and maps uses that information to find restaurants within an address close to that passed in location.

相反,我希望能够用GPS找到我的位置(因为它现在可以轻松的),但是,而不是寻找的东西在地图上(已建成),我希望能够找到其他的GPS功能的Andr​​oid手机。我得到,他们将不得不同时被广播他们的GPS信号,以及(因为它们不具有存储有某种中央数据库作为餐厅将其数据)。但是,我不只是想找到这些手机,我想送/从这些手机接收数据(用正确的权限很明显)。

Instead, I want to be able to use the GPS to find my location (as it can now easily), but instead of finding things on a map (which is already built in), I want to be able to find other GPS enabled Android phones. I get that they will have to be broadcasting their GPS signal at the same time as well (since they don't have their data stored with some sort of central database as a restaurant would). However, I don't just want to FIND these phones, I want to send/receive data from these phones (with correct permissions obviously).

现在,我发现像凹凸API。然而,BUMP使用手机传感器引发本次搜索。所以基本上,如果你凸点手机与另一个,并有应用程序运行时,它就会继续使用GPS找到你刚才碰到有和它们之间交换数据的另一部手机的位置。这就好比正是我想要的不过他们的API来完成,它们不提供,只是说,功能喂,给我所有的手机从我英里的范围内。

Now, I've found things like the Bump API. However, BUMP uses the phones sensors to spark this search. So basically, if you "bump" your phone with another and have the app running, it will THEN go ahead and use GPS to find the location of the other phone you just bumped with and exchange data between them. This is like EXACTLY what I want to do however in their API, they do not provide the functionality to just say, "Hey, give me all phones within a mile from me."

我还发现的API,可以做正是我需要的,但他们必须在相同的蓝牙范围内或在同一Wi-Fi网络,它不适合什么,我需要在所有的。

I've also found API's that can do exactly what I need but they have to be on the same Bluetooth range or on the same Wi-Fi network, which doesn't suit what I need at all.

难道你们知道的任何东西,可以适合正是我需要的已经存在?还是有办法来也许修改凹凸API(如果你已经这样做了),不具备使用手机的传感器和直接找到手机信息通过GPS为你身边的手机呢?或者是有什么存在通过3G / 4G网络,而不是只有Wi-Fi /蓝牙?

Do you guys know of anything that can fit exactly what I need that already exists? Or a way to maybe modify Bump API (if you've done it), to not have to use the phone sensors and find phone information directly through GPS for phones around you? Or is there something that exists over a 3g/4g network instead of only wi-fi/Bluetooth?

谢谢你们。

推荐答案

要通过GPS做到这一点,你就必须有所有的手机经常发布他们的位置到网络服务器上,这可能会再告知其他人他们附近。

To do this via GPS, you would have to have all the phones frequently posting their locations to a network server, which could then inform them of others nearby.

不用说,这将选择在只有!

Needless to say this would be opt-in only!

和它可能对电池寿命造成负面后果,除非你把它更新不频繁,这可能会限制它的可用性。

And it may have negative consequences for battery life, unless you make it update infrequently, which may limit its usability.

具有明确的触发操作两个电话的优点是,它们只需要查询GPS和通知服务器,以找到彼此的位置时,他们已经都被触发。

The advantage of having an explicit trigger action to both phones is that they only need to query the GPS and inform the server to find each other by location when they've both been triggered.

这篇关于采用Android GPS检测到跟其他手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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