WiFi-Direct: how to connect and interact with peers programmatically without user intervention?

Are we trying to create an application in which we need a direct WiFi application to automatically check Peers and connect without any user intervention? I saw that we have a demo version in developers.android with a demo version, but it has activity from the user to check and connect.

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

Thanks.

+4
source share
2 answers

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

0
source

There are a few things you should consider when sending data via wifi direct

After connecting, one device will be the owner of the group, and the other client

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

You will find out who became the owner of the group only at run time.

After connecting, you must send some data from the client to the server, which contains information about its IP address. This is because the server will not know the IP address of the client.

This way you can only send data. Because by this time you will find out which device has an IP address.

Greetings.

0
source

Source: https://habr.com/ru/post/1403506/


All Articles