Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 924
varun Avatar asked Apr 22 '15 11:04

varun


People also ask

How do I transfer files between Android phones using Wi-Fi Direct?

Send files with Wi-Fi Direct: Open Files, touch and hold a file you want to send, and go to More > Share > Wi-Fi Direct. When another device is detected, touch its name to establish the connection and begin file transfer. Receive files with Wi-Fi direct: Enable Wi-Fi.

What can I do over Wi-Fi Direct?

With the ability to connect two or more phones or tablets, Wi-Fi Direct eliminates the need for an internet connection. Sharing files, printing documents, and screencasting are the primary uses of Wi-Fi Direct on mobile devices.

What is P2P mode?

Wi-Fi Direct (also known as peer-to-peer or P2P) allows your application to quickly find and interact with nearby devices, at a range beyond the capabilities of Bluetooth. The Wi-Fi Direct (P2P) APIs allow applications to connect to nearby devices without needing to connect to a network or hotspot.


1 Answers

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

like image 83
Dr.Jukka Avatar answered Sep 23 '22 02:09

Dr.Jukka