Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
567 views
in Technique[技术] by (71.8m points)

connect to android devices using wifi direct without prompt

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.

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...