Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiFi-Direct : How to Connect and interact with peers programmatically without user intervention?

We are trying to build an app where we need the WiFi direct application to check for Peers automatically and connect without any user intervention? I saw that we do have a Demo version in developers.android with a Demo but it has with Activity from user to check and connect.

Any help on how to do this/direction is appreciated.

Thanks.

like image 503
Ratnakar Avatar asked Nov 13 '22 08:11

Ratnakar


1 Answers

There are some things that you should consider while sending data via wifi direct

Once connected, one device will be group owner and the other client

The group owner will have fixed IP address i.e. 192.168.49.1

You will know which became group owner only at runtime.

Once connected, you have to send some data from client to server that contains information about its IP address. This is done because server will have no idea of client's IP address.

That way, you can only send data. Because, by this time you will know which device has what IP address.

Cheers.

like image 93
Dipendra Avatar answered Nov 16 '22 04:11

Dipendra