I am creating an app which can monitor elapsed time taken for a particular task. The times are taken from server and its working fine. But when I added offline feature , I take time from System.currentTimeMillis(); . There is problem ,if user change their phone time ,then they can easily cheat the elapsed time. Is there any other way I can fetch duration of particular task interval.Or How can I prevent this cheating? I already search stack overflow for a good answer. but can't find anything. Please help
You could start a thread to count the elapsed time yourself. Place counter inside a service, to prevent it closing with the app. If the service if closed by the device restarting or whatever, then it needs to go online to confirm the time again before continuing.
As long as the device is not restarted or the service being closed by system due to low resources, the user will be able to stay offline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With