Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The simplest thing is to agree on two machines (pc and smartphone) about what ip addresses they have through the third server machine, both machines send a message about themselves to the server, and the server, in turn, looks at the ip address from which it came and if it is the same - so these two messages came from machines located nearby.
In rare cases, this will not work if, for example, there is an 'Internet accelerator' based on load balancing between two or more providers, as well as if the ip address changes at the time the message is sent (yes, you should be very unlucky, but it is possible)
Correct - implement broadcasting within the local network, the server is not needed, but on android this is problematic.
But there is a network service discover(works on the basis of the DNS-SD mechanism) the first code example from Google
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question