Ratnakar
Ratnakar

Reputation: 163

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.

Upvotes: 5

Views: 4009

Answers (2)

Dipendra
Dipendra

Reputation: 1557

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.

Upvotes: 1

HP256
HP256

Reputation: 1

Try to make it a service. Refer the below link http://developer.android.com/reference/android/app/Service.html

Upvotes: 0

Related Questions