0

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.

LunaVulpo
  • 3,043
  • 5
  • 30
  • 58

1 Answers1

0

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 :

android.permission.SET_TIME

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.

RenegadeAndy
  • 5,440
  • 18
  • 70
  • 130