使用wifi直接连接到android设备,无需提示 [英] connect to android devices using wifi direct without prompt
问题描述
我正在尝试使用WIFI Direct连接两个Android设备,但我成功了.但是问题在于,另一台设备启动连接后,第二台设备必须接受连接提示.对于我要实现的目标,这是不可取的.我在堆栈溢出本身中看到了一些帖子,说目前不可能.但是遇到了一个名为SUPERBEAM的应用程序,该应用程序可以直接通过WIFI用户连接,但没有提示.在Google中进行的搜索为我提供了来自xda论坛的以下链接,内容为
i am trying to connect two android devices using WIFI direct and i was successful. But the problem is the second device has to accept the a connection prompt after the other device initiates the connection. It is undesirable for what i am trying to achieve. I saw a few post here in stack overflow itself saying that currently its not possible. But came across an app called SUPERBEAM which user WIFI direct but without the prompt. A search in google gave me the following link from xda forum which says
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.
但是在哪里我找不到有关如何实现此目的的信息.有谁能够帮我.链接在这里 http://forum.xda-developers.com/showthread.php?t=2177133
But no where i found information on how to implement this. Can anybody help me. Here is the link http://forum.xda-developers.com/showthread.php?t=2177133
推荐答案
您确实可以简单地使用API中的createGroup函数来创建一个组,该组也构成了访问点.这里的第一个问题是接入点名称&密码是自动设置的,您无法更改.
You could indeed simply use the createGroup function from the API to create a group, which also makes the access point. The first problem here is that the access point name & password are set automatically, and you can not change them.
因此,您确实需要将信息传递给连接方,为此,我建议使用本地服务广告,并在其中使用实例名称.
So, you do need to pass the info to the connecting party, and for this, I would suggest using the local service advertising, and using the instance name there.
为此做了一个简单的测试应用程序,您可以从Drakka/MyWifiMesh下的 Github中找到它,,还对该主题进行了一些讨论可以从我的博客
Did make simple test app for this and you can find it from Github under DrJukka/MyWifiMesh, also some discussions on the topic can be found from my blog
这篇关于使用wifi直接连接到android设备,无需提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!