-2

I'm trying to trigger an action inside my Android app on multiple devices at the exact same time (or with the lowest delay/shift possible).

The devices are strictly similar (brand, model, version), plugged via USB to a Macbook Pro. I have 4 devices so far but the final solution will include many more so I need a solution that works with a lot of devices.

I have tried using sockets (Socket.io and regular WS) over Wifi and USB, but the delay slightly increases for each device so the action is not triggered in sync.

I also tried sending a broadcast UDP packet over USB, this gives way better results but seems very inconsistent: the max delay goes from 10 to a 100ms.

Syncing clocks was another option I was considering but not sure how accurate can it get across many devices (and NTP seems tricky on Android)

Any idea or pattern to address this kind of requirements? Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.