简体   繁体   English

Android:无线连接两部手机?

[英]Android: Connect two phones wirelessly?

I'm interested in fleshing out an idea for a Android phone app, and I'm wondering if this is possible. 我有兴趣充实Android手机应用程序的想法,我想知道这是否可行。 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. 所以我希望应用程序在手机A的后台运行,然后当它找到另一个Android手机B时,它会保存某些信息,如时间,GPS位置,只是状态变量。

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? 我会通过本地ad-hoc Wi-Fi连接,还是经常播放蓝牙?

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. 使用WiFi可以体验到更好的范围和速度,但据我所知,这需要路由器。

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. 如果有两个人在他们的手机上安装了应用程序并且同意将他们的GPS坐标共享,那么当人们四处移动时,您可以将两组gps坐标上传到服务器。 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. 这基本上就是Bump的工作原理。 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. 在发现附近的手机后,如果您不想通过互联网分享,您可以触发蓝牙配对和共享。

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. 我发现了如何做到这一点,在两部手机上使用viewranger应用程序,创建用户并在两部手机上登录应用程序。 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. 然后第二部手机(gps坏了)用于跟踪我后口袋里的用户。 The user in both cases is me. 两种情况下的用户都是我。 The problem with this is that a phone signal is required. 这个问题是需要电话信号。

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

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