Does Android use NTP for time synchronization?

Do Android devices use Network Time Protocol (NTP) to synchronize time?

In my device settings, I see a checkbox with the following text “synchronize with the network”, but I don’t know if they use NTP.

I need this for my undergraduate dissertation, for which I use GPS. To get an accurate GPS signal, the receiver must have an accurate clock.

I found this blog entry on the Internet, but I'm not sure if it will tell the truth: NTP acceleration, GPS Lock in Android

+51
android time gps ntp
Jan 17 '13 at 14:16
source share
4 answers

I know about Android ICS that it uses a special service called NetworkTimeUpdateService . This service also implements NTP time synchronization through the NtpTrustedTime singleton.

In NtpTrustedTime NTP server is requested by default from the Android system line source:

 final Resources res = context.getResources(); final String defaultServer = res.getString( com.android.internal.R.string.config_ntpServer); 

If the automatic time synchronization option is checked in the system settings and the NITZ time service is not available, then the time will be synchronized with the NTP server with com.android.internal.R.string.config_ntpServer .

To get the value of com.android.internal.R.string.config_ntpServer you can use the following method:

  final Resources res = this.getResources(); final int id = Resources.getSystem().getIdentifier( "config_ntpServer", "string","android"); final String defaultServer = res.getString(id); 
+41
Jan 25 '13 at 13:55
source share

I wanted to ask if Android devices use network time protocol (ntp) to synchronize time.

For a general time synchronization of a telephony device, where the wireless provider provides NITZ information , it will use NITZ. I understand that NTP is used in other circumstances: wireless NITZ providers, WiFi, etc.

Your quoted blog post offers another circumstance: on-demand synchronization in support of GPS. This is certainly possible, although I do not know if it is used or not.

+11
Jan 17 '13 at 14:22
source share

I have a Samsung Galaxy Tab 2 7.0 with Android 4.1.1. Apparently, it does NOT sync with ntp. I downloaded an application that says that my tablet takes 20 seconds from ntp, but it cannot install it if I'm not root.

+9
Apr 29 '13 at 17:15
source share

An inaccurate answer to your question, but some information: if your device uses NTP for time (for example, if it is a tablet with 3G or GPS capabilities), the server can be configured in /system/etc/gps.conf - obviously this file can be edit only with root access, but it is available for viewing on unloaded devices.

+5
Dec 29 '13 at 2:56
source share



All Articles