Is there a way to detect when the user has changed the clock time on their device?

前端 未结 5 1108

Is there a way to detect when the Android system clock has been reset by the user in Android?

I\'m designing an app which uses system time to determ

5条回答
  •  情深已故
    2020-11-27 03:05

    If you don't mind your app to throw cheats in case of user's clock will get updated due to *DT/*ST shifts, occasional time syncs with NTP sources that can rewind your clock, your own process's stalling, you can implement a "consequential" check on system time so that if time went "back" you assume it's a "cheat". Otherwise, you have to rely on the server which will be your source of "valid" time. And even then, your server's time can too go backwards occasionally.

提交回复
热议问题