在没有提示的情况下使用 wifi direct 连接到 android 台设备

connect to android devices using wifi direct without prompt

我正在尝试使用 WIFI 直接连接两个 android 设备,我成功了。但问题是第二个设备必须在另一个设备发起连接后接受连接提示。这对我想要实现的目标来说是不可取的。我在堆栈溢出本身中看到一些 post 说目前这是不可能的。但是遇到了一个名为 SUPERBEAM 的应用程序,该应用程序用户 WIFI 直接但没有提示。在 google 中的搜索给了我来自 xda 论坛的以下 link,上面写着

SuperBeam creates an access point using Android's WiFi direct API's.     
This essentially works like hotspot mode in old devices, but it is 
guaranteed to work on newer devices like Nexus 7. Moreover, this mode 
allows older devices to connect and receive files without having to 
support WiFi direct's peer-to-peer connections and, more importantly, it 
gets rid of the annoying "accept connection" prompt.

但是我没有在哪里找到有关如何实现它的信息。有谁能够帮助我。这是 link http://forum.xda-developers.com/showthread.php?t=2177133

这可以使用Xposed框架来实现。您需要添加代码并安装应用程序。 phone 需要 root 才能正常工作。我已经在多个 Samsung phones 上测试过它并且它有效。 查看此答案了解详情:How to auto-accept Wi-Fi Direct connection requests in Android

您确实可以简单地使用 API 中的 createGroup 函数来创建一个组,这也构成了访问点。这里的第一个问题是接入点名称和密码是自动设置的,您无法更改它们。

因此,您确实需要将信息传递给连接方,为此,我建议使用本地服务广告,并在那里使用实例名称。

为此制作了简单的测试应用程序,您可以从 Github under DrJukka/MyWifiMesh, also some discussions on the topic can be found from my blog

中找到它