I have an idea for an app, but it requires near-instant transmission (much less than 2 second delay) of an int 1-5000 to another device. The basic premise is that one user long-presses a button for a certain amount of time, I measure that time, then upon finger release display a picture on the other device for n milliseconds.
I also need to be able to scale this from 2 users to upto maybe 500 at the same time ideally? Or if that doesn't work "broadcast" the int to all device simultaneously, that's also acceptable.
I have done this successfully using TCP/UDP sockets and it worked great and smoothly, but only for 2 users at the same time. It hurts my brain trying to figure out how to scale it up, and the source code for that is long gone anyways, I could make it again in a couple days if sockets is the only solution, but trying to see if anyone has any other ideas.
So basically, what is the easiest and relatively low latency method to give my app running on another device an int? Even one word hints are highly appreciated.
I'm familiar with Android Development Studio and have basic (uni level) knowledge of java.