What you are trying to do over Wifi Network is Called "Publisher Subscriber Framework"
one or many android devices publishes data and one or many subscribers receive data .
Java has a a framework in this called Java Messaging Service JMS
Publish/subscribe model
The publish/subscribe model supports publishing messages to a particular message topic. Subscribers may register interest in receiving messages on a particular message topic. In this model, neither the publisher nor the subscriber knows about each other. A good analogy for this is an anonymous bulletin board.
Zero or more consumers will receive the message.
There is a timing dependency between publishers and subscribers. The publisher has to create a message topic for clients to
subscribe. The subscriber has to remain continuously active to
receive messages, unless it has established a durable subscription.
In that case, messages published while the subscriber is not
connected will be redistributed whenever it reconnects.
JMS provides a way of separating the application from the transport layer of providing data. The same Java classes can be used to communicate with different JMS providers by using the Java Naming and Directory Interface (JNDI) information for the desired provider. The classes first use a connection factory to connect to the queue or topic, and then use populate and send or publish the messages. On the receiving side, the clients then receive or subscribe to the messages.
IF YOU THINK THATS WHAT YOU WANT YOU CAN USE RabbitMQ for android.you can use it to send messages over local network
Here is the link where you can start LINK