Hi,
I need to ensure that my app gets the correct time, not the time set by the user in settings.
So for instance, once the user starts the app, I'd want to get a timestamp. The user would see the elapsed time on a timer on screen updated every second. When the user exits the app, and after some time restarts the app , the timer would just get the current time and compare it with the original timestamp it kept. So basically, just like the stopwatch in the Clock.App on iPhone.
Now the problem with the clock.app is that if the user goes and advances the time in Settings by one hour, this will influence the timer. Obviously I don't want that, because in my app, that would be cheating.
I'd need to get a more trustworthy time source to compare to.
I could get the time from the internet. But the problem is that I'd need internet connection , so only works on if there is an internet connection. My app needs to work offline preferably.
Is there some kind of internal clock I can access?
Is there a way of checking whether the user has changed the date time in Settings?
Any other ideas?
Thanks