Communication between two Android phones using a Wi-Fi network
I want to communicate between two android phones, both phones are connected to the same wifi network. Knowing the IP address, I can use sockets directly to communicate with both devices, but my question is, is it possible to get the IP address at runtime? Or is there another way I can do this?
source to share
You can use jmDNS to achieve this. This is a really useful library, and once you find all devices connected to the same wifi, you can get their ip and port so you can establish a connection. You can read more on how to use it here .
Or you can use Android Wi-Fi Direct API which only works for API level 14+. Here's some more API information: Wifi-Direct .
Hope this is what you are looking for! :)
source to share
You can use Google Android NSD service.
Check out http://developer.android.com/training/connect-devices-wirelessly/nsd.html
source to share