I need to synchronize time between two or more android devices. But I don’t need change local time, only knew different in time on different devices.
I cannot assume that devices have access to GPS or GMS or even to Internet. The connection is made in intranet by WIFI.
Is a API on Android which help me make this quick?
For connection I use Socket and ServerSocket classes.
Update: I search API which help me to exchange data about time and synchronize it.
You can use :
http://developer.android.com/reference/android/os/SystemClock.html
System.setCurrentTimeMilli() – this will change the system time and all apps / widgets which use the system time should then be updated.
Additionally you will need :
as a uses permission in the manifest.
As for the connection and communicating between the phones – I dont know what problem it is you are solving – but you could have a server socket on one phone – and sockets on the other – and use those to communicate.