Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

synchronize system time in 2 phones

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.

like image 844
Junfei Wang Avatar asked Mar 04 '13 22:03

Junfei Wang


People also ask

How do you sync two phones together?

Go to the phone settings and switch on its Bluetooth feature from here. Pair the two cell phones. Take one of the phones, and using its Bluetooth application, look for the second phone you have. After turning on the Bluetooth of the two phones, it should automatically display the other on the "Nearby Devices" list.

Why is clock synchronization between network devices important?

The Importance of Time Synchronization for Your Network In modern computer networks, time synchronization is critical because every aspect of managing, securing, planning, and debugging a network involves determining when events happen. Time also provides the only frame of reference between all devices on the network.

What is synchronization in mobile?

When you sync. You can see and update your synced info on all your devices, like bookmarks, history, passwords, and other settings. You'll sign in automatically to Gmail, YouTube, Search, and other Google services.


1 Answers

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.

like image 59
Gabe Sechan Avatar answered Oct 08 '22 22:10

Gabe Sechan