The Android ICS system supports time synchronization over the Internet.

Source: Internet
Author: User

I have read articles on the Internet to analyze the Network Time Synchronization of the Android system. The reasons are as follows:

  1. Android time synchronization uses not Internet-based NTP, but the optional service NITZ provided by the carrier. However, tianchao, a well-known operator with high charges and few services, is basically not supported.
  2. Even if the operator provides NITZ, Android Synchronizes time only when the system is started. In daily use, the phone is rarely restarted, and the time is still inaccurate.

Therefore, we used to synchronize the next ClockSync software from time to time. However, this software requires the root permission. To achieve automatic synchronization, a process must be resident in the background. After I recently changed my mobile phone, I found that it was still accurate after a while, now we feel that Android supports Network Time Synchronization Through the Internet (it is unlikely that the tianchao operator suddenly began to support NITZ ).

Because I am not familiar with the Android system, I cannot analyze the kernel code as the author of the article, so I manually verified my guess.

The verification steps for my initial design are as follows:

  1. Unplug the SIM card, disable WiFi, and use network time synchronization.
  2. Manually modify the system time, one hour ahead of schedule
  3. Enable Network Time Synchronization
  4. Enable Wifi and check whether the time can be restored

I am also surprised that the time has been restored by step 3. Because I unplugged the SIM card and disabled wifi, there was no way to get the standard time from the outside. Therefore, I estimate that even if the network time synchronization is removed from the system, the network time is recorded. When the Network Time Synchronization settings are restored, the correct time is restored as a reference.

My verification failed due to the recovery time in step 3, so I modified the test step and added a restart operation to reset the system before enabling the network time synchronization.

  1. Unplug the SIM card, disable WiFi, and use network time synchronization.
  2. Manually modify the system time, one hour ahead of schedule
  3. Restart mobile phone
  4. Enable Network Time Synchronization
  5. Enable Wifi and check whether the time can be restored

Due to a restart operation, after network time synchronization is enabled, the system still maintains the wrong time (which can also prove my previous conjecture ). Next, perform Step 5. After enabling Wifi, the system will automatically restore to the correct time.

At this time, my SIM card is still in the unplugging status. Therefore, it can be proved that Android ICS can synchronize time from the Internet. In addition, this synchronization is not performed only when the system is started. At least the time will be synchronized when wifi is enabled. Therefore, in ICS and later versions, the network time synchronization function can be used. As long as there is an available Internet connection, no third-party synchronization software such as ClockSync can automatically maintain accurate time.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.