You are confusing yourself with TCP (or UDP which is a connectionless protocol, similar to TCP) and network topology, ring in your case maybe.
I would, in this case, suggest that you do not write such a thing. Instead, I would recommend that you create a server for TCP clients and let it communicate with the network. Through your local network, from the router. That server would listen to every message from the clients, client would share their data on the server through network. Then you can generate a response for each of the client.
First step is to get familiar with
networking in Java[
^]. Android uses Java as official programming language, thus a program written in Java would work fair in Android with a few changes as per Android standards.
In Android, these resources about networking can help you getting started for communicating through WiFi and other mediums for data sharing.
http://developer.android.com/training/building-connectivity.html[
^]