android配置时间服务器+亚洲主要的授时服务器

    xiaoxiao2021-12-14  18

    http://blog.csdn.net/u010725171/article/details/48541915

    我们知道,Android是通过连接指定的ntpServer来获取网络时间,而不同的服务器带来的延迟也不尽相同,通常情况下,我们自然是期望尽快获取时间,那么我们就需要对ntpServer有一定的筛选,尤其是在选择默认的ntpServer的时候。

    android中配置ntpServer的源文件:

    frameworks/base/core/res/res/values/config.xml

    此外,调整一下切换不同服务器之间的timeout也能加快获取网络时间

    亚洲主要的一些授时服务器: http://www.pool.ntp.org/zone/asia

    本猿实际测试中发现,下列服务器响应比较快,最大的平均响应时间低于150ms(可能与网络也有一定的关系,不同地方可能有较大的差异):

    sg.pool.ntp.org tw.pool.ntp.org 3.asia.pool.ntp.org jp.pool.ntp.org cn.pool.ntp.org hk.pool.ntp.org th.pool.ntp.org s2g.time.edu.cn

    PS:国内主要的ntp服务器地址:

    http://www.douban.com/note/171309770/

    转载请注明原文地址: https://ju.6miu.com/read-964981.html

    最新回复(0)