0

The api im calling requires that i send a unix timestamp in seconds in order to get the changes that occurred to an entity since that time. i can't use currentTimeMillis because that can be changed by user, and i cant use elapsedRealtime() is device dependent is there away to get this time? source: https://developer.android.com/reference/android/os/SystemClock

AmSabba
  • 67
  • 5

1 Answers1

1

You can create a repository that fetches the Unix time from a server, like this one

http://worldclockapi.com/api/json/utc/now

The only concern is that you need internet permission.

Francesc
  • 25,014
  • 10
  • 66
  • 84