You can do this easily in Android through the Networking APIs available, but remember you cannot do this without a router and the network connection. :laugh:
Your application will connect to the network, and look for any active clients on the network — maybe others would need to show themselves as active, and for this you can provide them with the app as well and enable the network visibility. After that, you can transfer the data on the sockets. For instance, this documentation on Android Developer website talks about peer-to-peer connectivity with WiFi;
Creating P2P Connections with Wi-Fi | Android Developers[
^] and this is exactly what you need.
Performing Network Operations | Android Developers[
^]