Android:无线连接两部手机?
我有兴趣充实 Android 手机应用程序的想法,我想知道这是否可行。因此,我会让应用程序在手机 A 的后台运行,然后当它找到另一部 Android 手机 B 时,它会保存某些信息,例如时间、GPS 位置、状态变量。
但如果另一部手机也运行相同的应用程序,两部手机就会连接并共享琐碎的非私人信息。
假设一下,这可能吗?我会通过本地临时 Wi-Fi 连接,还是不断广播蓝牙?
I'm interested in fleshing out an idea for a Android phone app, and I'm wondering if this is possible. So I would have the app running in the background on Phone A, then when it finds another Android phone B, it saves certain information like time, GPS location, just state variables.
But if the other phone is also running the same app, the two phones connect and share trivial non-private information.
Hypothetically, would this be possible? Would I go through a local ad-hoc Wi-Fi connection, or constantly broadcast Bluetooth?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果两个人都有相同的应用程序,你可以用迂回的方式来做。如果两个人在手机上安装了该应用程序并同意共享其 GPS 坐标,则您可以在人们走动时将两组 GPS 坐标上传到服务器。然后,服务器可以比较哪些人彼此关系密切。当用户想要与其他用户共享信息时,手机只需要询问附近的服务器,就可以通过互联网完成共享。这本质上就是 Bump 的工作原理。将两部手机碰撞在一起会触发对服务器的呼叫,以查看还有谁在同时碰撞该附近区域。发现附近的手机后,如果您不想通过互联网共享,也许可以触发蓝牙配对和共享。
If both people have the same app, you could do it in a round about way. If two people installed the app on their phone and agreed to have their gps coordinates shared, you could upload both sets of gps coordinates to a server as the people move around. The server could then compare which people are close to each other. When the user wants to share information with another user, the phone just needs to ask the server who is in their vicinity and sharing could be done over the internet. This is essentially how Bump works. Bumping two phones together triggers a call to the server to see who else is bumping in that vicinity at the same time. After phones close by are discovered, you might be able to trigger bluetooth pairing and sharing if you don't want to share over the internet.
蓝牙是两部手机直接相互通信的最简单方式。然而,两部手机都必须通过“设置”->“无线”->“蓝牙”菜单进行配对。使用 WiFi,您会体验到更好的范围和速度,但据我所知,这需要路由器。
Bluetooth is the easiest way for two phones to communicate directly with each other. However, both phones would have to be paired through the Settings->Wireless->Bluetooth menu. You would experience better range and speed with WiFi, but this requires a router as far as I know.
我找到了如何做到这一点,在两部手机上使用 viewranger 应用程序,创建一个用户并在两部手机上登录该应用程序。我将自己设置为用户。然后第二部手机(GPS 坏了的那部)被用来追踪我后口袋里的用户。
这两种情况的用户都是我。
这样做的问题是需要电话信号。
I found out how this can be done, use the viewranger app on both phones, create a user and log into the app on both phones. I set this up with myself as the user. Then the second phone (the one with broken gps) is used to track the user who is in my back pocket.
The user in both cases is me.
The problem with this is that a phone signal is required.