Discussion:
Android time
David L Neil
2011-11-30 20:47:29 UTC
Permalink
Per full-fat Linux systems (via NTP) does Android offer program/API
level access to an highly accurate and common-access time source?

(I don't (yet) have an Android phone or even this level of access?trust
to one)

Accuracy: tenths of a second but hundredths better. Available to any and
all users.

Source might be (I'm imagining) GPS or a cell system heartbeat, if not
traditional Internet NTP.

Will be v.happy to receive pointers to 'homework reading'...

--
Please advise,
=dn

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Jethro Carr
2011-11-30 20:51:38 UTC
Permalink
On Thu, 2011-12-01 at 09:47 +1300, David L Neil wrote:
> Per full-fat Linux systems (via NTP) does Android offer program/API
> level access to an highly accurate and common-access time source?
>
> (I don't (yet) have an Android phone or even this level of
> access?trust
> to one)
>
> Accuracy: tenths of a second but hundredths better. Available to any
> and
> all users.
>
> Source might be (I'm imagining) GPS or a cell system heartbeat, if
> not
> traditional Internet NTP.
>
> Will be v.happy to receive pointers to 'homework reading'...


hi David,

Stock android supports getting time from the network, but that doesn't
work on Vodafone in NZ (they don't provide the time info), unsure about
Telecom XT.


You can download apps (clocksync is the one I use) that provide NTP
synchronisation, but IIRC, they might require a rooted phones.

Considering the phones have GPSes there may be some apps out there that
can use that as a source.

regards,
jethro

--
Jethro Carr
www.jethrocarr.com
www.amberdms.com
Mark Foster
2011-11-30 21:13:32 UTC
Permalink
On 01/12/11 09:51, Jethro Carr wrote:
> Stock android supports getting time from the network, but that doesn't
> work on Vodafone in NZ (they don't provide the time info), unsure
> about Telecom XT.

+1 for this. Annoying.

> You can download apps (clocksync is the one I use) that provide NTP
> synchronisation, but IIRC, they might require a rooted phones.

I use Clocksync. A rooted phone can be automatically kept up to date. A
non-rooted phone requires manual intervention but the clocksync app
makes this pretty straightforward, however it can only keep you to
within 30 seconds of correct (as you can only set to the minute).

My Android clock runs fast to the tune of about a minute per week, so
I'm regularly using Clocksync to sort things out. It's imperfect but
workable.

Mark.

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
David L Neil
2011-11-30 21:43:08 UTC
Permalink
On 12/01/2011 10:13 AM, Mark Foster wrote:
> On 01/12/11 09:51, Jethro Carr wrote:
>> Stock android supports getting time from the network, but that doesn't
>> work on Vodafone in NZ (they don't provide the time info), unsure
>> about Telecom XT.
>
> +1 for this. Annoying.

=Thanks both.

=I had heard of this (sad - and so unnecessary) issue and noted that the
(simple) phone I had overseas and transferred to Vodafone New Zealand
doesn't even adapt to summer time clock changes (for which I,
previously, blamed its heritage)...


>> You can download apps (clocksync is the one I use) that provide NTP
>> synchronisation, but IIRC, they might require a rooted phones.
>
> I use Clocksync. A rooted phone can be automatically kept up to date. A
> non-rooted phone requires manual intervention but the clocksync app
> makes this pretty straightforward, however it can only keep you to
> within 30 seconds of correct (as you can only set to the minute).
>
> My Android clock runs fast to the tune of about a minute per week, so
> I'm regularly using Clocksync to sort things out. It's imperfect but
> workable.

=yes, the inherent inaccuracy of the local time base (and comparatively
across multiple users) is a show-stopping issue for this
application/feasibility study. Hence the question.

=looking at Clocksync it seems to confirm my dim recollection that
Android time is not particularly accurate (+-30s). Arghhhh! This is
barely "accurate", even for "when's the next bus/train/TV pgm
questions"! (hence my difficulty in accepting the fact)

=I see no mention of Clocksync having an API. Given the geo-location
component, it would be rather handy. So I'll attempt to contact the
author. (Thanks for the pointer)

=However I realise that for this application the code could be written
so that it doesn't care which time zone the time-base uses - just as
long as the same time info is accessible by multiple sources
concurrently (and thus, consistently).

=Obviously plain vanilla NTP will do the job. However it seems
reasonable (YMMV) that with all the time-bases available within the GPS
and cell systems that there would be a 'native' solution to time
questions...

--
Regards,
=dn

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Robin Paulson
2011-11-30 22:00:01 UTC
Permalink
On Thu, 01 Dec 2011 10:43:08 +1300, David L Neil wrote:
> =looking at Clocksync it seems to confirm my dim recollection that
> Android time is not particularly accurate (+-30s). Arghhhh! This is
> barely "accurate", even for "when's the next bus/train/TV pgm
> questions"! (hence my difficulty in accepting the fact)
>
> =I see no mention of Clocksync having an API. Given the geo-location
> component, it would be rather handy. So I'll attempt to contact the
> author. (Thanks for the pointer)
>
> =However I realise that for this application the code could be
> written so that it doesn't care which time zone the time-base uses -
> just as long as the same time info is accessible by multiple sources
> concurrently (and thus, consistently).
>
> =Obviously plain vanilla NTP will do the job. However it seems
> reasonable (YMMV) that with all the time-bases available within the
> GPS and cell systems that there would be a 'native' solution to time
> questions...

does android have gpsd available?
https://en.wikipedia.org/wiki/Gpsd

there's no API for it, but it provides the time over tcp/ip to other
software. not that accurate given the 'best-effort' of network packets,
but better than 30 seconds precision

--
robin

http://fu.ac.nz - Auckland's Free University

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Jaco
2011-11-30 21:56:38 UTC
Permalink
>Stock android supports getting time from the network

I serve up NTP to the DHCP clients on my LAN.
Just wondering if this could do the trick

- J

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Loading...