I need to make sure that my application receives the correct time, and not the time specified by the user in the settings.
So, for example, as soon as the user starts the application, I want to get a timestamp. The user will see elapsed time on a timer on a screen updated every second. When the user exits the application and after a while restarts the application, the timer will simply get the current time and compare it with the original time stamp that he saved. Thus, basically, just like the stopwatch in Clock.App on the iPhone.
Now the problem with clock.app is that if the user goes and advances the time in the settings by one hour, this will affect the timer. Obviously, I do not want this because in my application it will be cheating.
I need to get a more reliable source of time for comparison.
I could get time from the internet. But the problem is that I need an Internet connection, so it only works if there is an Internet connection. My application should work offline.
Are there any internal clocks that I can access?
Is there a way to check if the user has changed the date time in the settings?
Any other ideas?
thanks
source
share