pizzaMan5000 / Android_GPS_Time_Sync

Android app that get the time from GPS time and set it as the system time. Requires ROOT access!
http://www.swampsoft.org/android/androidgpstimesync/
4 stars 2 forks source link

Android 6.0 compatibility & GPS Week Number Rollover fallout 2.0 workaround #1

Closed cosmopol closed 4 years ago

cosmopol commented 4 years ago

May I still commit to the project and have you check the results?

pizzaMan5000 commented 4 years ago

updates received. I did not look at it real hard though. I don't have a test device currently. I just added them and hopefully it works OK for the 8 users who downloaded it from the Play Store :)

cosmopol commented 4 years ago

I didn't test thoroughly either. We have to be careful though! We have crossed 50+ installs! See what a difference it makes! All those folks from the other GNSS sync apps now have switched to this product. lol ;-)

More possible issues:

1.) There still seems to be a redundant permission set left: Location - approximate location (network-based) 2.) The Android shell/cmd date command is tricky to handle, a more universal approach might be suitable. 3.) The app seems to block other GNSS apps, like OsmAnd~ (open source sat navigation app) - more testing needed!

PS: Why Android OS does not retrieve GNSS time whenever INET time is unavailable by standard is beyond me!

cosmopol commented 4 years ago

OK, there are no issues with Android_GPS_Time_Sync per se. All problems stem from my faulty GNSS firmware it seems. You can merge the request safely. I already could think of a lot of useful and small improvements already, one being a frequent validated time stamp backup to file (time does not flow backwards usually :-) ). Instead I urge you to merge this project with 'GPS test' (https://f-droid.org/en/packages/com.android.gpstest.osmdroid/). I believe the auxilliary service part should go there. Maybe there is a way to set the clock without root?

There are reports that to get a reliable and fast GNSS fix you actually need to have a good time. :-) See explanation below!

...

You already have good time within 20s on your android phone

Having approximate possition either via Wifi or from GSM network (within few km based on transmission towers)

Using A-GPS - it downloads fresh copy of almanac and ephemerides for all GPS satellites via internet, so you don't need to download it from the GPS satellites (which takes 30 sec for ephemerides and 15 minutes for almanac). With A-GPS, you can use hot start and have TTFF under 10 seconds.

...

(https://stackoverflow.com/questions/8308412/gps-how-ntp-time-injection-works)
cosmopol commented 4 years ago

https://github.com/barbeau/gpstest