5

My Institute has a server which has a IP address 192.168.1.xxx I want to set my sync server to that IP address. All other time sync servers are blocked so I am asking this. If it is possible then please reply.

In Android there is no option to manually add server address like it is there in windows time setting.

helloansuman
  • 51
  • 1
  • 1
  • 2

2 Answers2

9

Android has no option for NTP syncing – time synchronization takes place by other means (via your mobile carrier, see Where time information is received from the network? and What is the synchronization source for the internal clock). To enable time synchronization via NTP, you can e.g. use ClockSync – but without root powers, 3rd party tools are pretty much limited, as they're not allowed for "fine adjustment": the "finest interval" they can adjust by is 30 seconds.

For more details, be welcome to see:

To make these sources easier to find, I've just linked them to our clock tag-wiki.

Izzy
  • 91,166
  • 73
  • 343
  • 943
  • So basically, the answer is no? I want my phone to connect to that IP address and get the time. I think there are no such apps till now. Btw thanks for your reply @lzzy. I will keep on searching more. – helloansuman Feb 02 '16 at 13:20
  • Basically the answer is "no, not without external tools, and even then with root only". Updating the time only when the difference is 30s or more IMHO doesn't count ;) – Izzy Feb 02 '16 at 14:06
  • Windows also use NTP servers to sync time? ex: time.windows.com, time.nist.gov – helloansuman Feb 02 '16 at 17:19
  • Who? This is Android.SE – I've got no idea what Windows does (my windows let in light at daytime, when open fresh air, in summer sometimes insects, but they don't sync time ;) My Linux machine uses NTP as well, yes. – Izzy Feb 02 '16 at 17:22
  • :) I was asking that because I am rooted and still ClockSync can't able to connect to my server when I gave the IP address. But my windows machine can sync with that IP. So I think IP based syncing is not possible. – helloansuman Feb 02 '16 at 17:30
  • Ah! Now I get the context. Is that Windows machine running an NTP server at all? As I wrote, I've got no idea how Windows machines might sync time across each other. MS always defined its own standards, so I'd not be surprised if they did here as well. – Izzy Feb 02 '16 at 17:48
  • No problem :). Thanks for all your replies. I am still wondering how to sync time through IP address. – helloansuman Feb 03 '16 at 04:56
  • Just make sure there really is an NTP server running on that target, I'd say? ;) – Izzy Feb 03 '16 at 07:09
  • I doubt if that is a NTP server. But as it is working on Windows I am wondering if there is a method exist in Android which can utilize the same protocol as Windows. – helloansuman Feb 03 '16 at 10:28
  • Off-topic here, but Windows seems to use Kerberos for that by default – but, according to the linked MS support article, can be configured to NTP ("Change the server type to NTP. To do this, follow these steps: …"). I doubt there's an Android solution for Kerberos time syncing. – Izzy Feb 03 '16 at 11:00
  • Wow you have done a great research. Thanks for the info. I want then kerberous to be supported by Android. Unfortunately that is not available I think. – helloansuman Feb 03 '16 at 14:17
  • Afraid so, unfortunately. Trouble is MS always generating its own standards :/ – Izzy Feb 03 '16 at 14:47
1

Anyone Still having this problem you can use ADB shell to change your device ntp-server.

$ adb shell settings put global ntp_server asia.pool.ntp.org
# test
$ adb shell settings get global ntp_server 
> asia.pool.ntp.org

You will need adb exe for this. replace the "asia.pool.ntp.org" with your server IP address. please refer to this link for more info Github