Reputation: 578
I'm doing a research project in which 2 android phones have to play the same sound file at EXACTLY same time, to do this I need the system time in each phone are synchronized to millisecond. My question is that, how to achieve this on code level? Now all current methods can only do second-level synchronization.
Upvotes: 7
Views: 1219
Reputation: 93569
You don't. If you need that, you need a real time OS, which Android isn't. Too many things can make it go wrong- clock skew, garbage collection, dalvik JIT differences, etc. You can get close to it using the real time clock functions, but you're never going to get that kind of performance assured in anything written on top of a VM on a multi-tasking OS.
Upvotes: 8