1
I want to synchronize the time between my android device and a raspberry pi. My android is synchronized automatically from the internet ( GMT + 2). I used this code to get the ntp server.
final Resources res = this.getResources();
final int id = Resources.getSystem().getIdentifier(
"config_ntpServer", "string","android");
final String defaultServer = res.getString(id);
Log.i("time",defaultServer);
Then I used this command to update the time on the raspberry working with the raspbian OS
sudo ntpdate -u 2.android.pool.ntp.org
24 Apr 17:07:06 ntpdate[20038]: adjust time server 77.20.139.240 offset 0.007060 sec
There is still 2 hours difference between the android and the linux. How can I set this GMT + 2 in linux ? Is such synchronization precise? I want to start advertising a beacon with the raspberry pi and measure the time it get to the android device to detect it so I will compare the two time stamps and the result will be in order of ms.
If there is still a 2 hour difference then they don't have the same NTP source or its a time zone setting difference. – Ramhound – 2016-04-24T17:39:06.620