What is TruetimeAndroid?

NTP client for Android. Calculate the date and time “now” impervious to manual changes to device clock time.

In certain applications it becomes important to get the real or “true” date and time. On most devices, if the clock has been changed manually, then a new Date() instance gives you a time impacted by local settings.

Users may do this for a variety of reasons, like being in different timezones, trying to be punctual by setting their clocks 5 – 10 minutes early, etc. Your application or service may want a date that is unaffected by these changes and reliable as a source of truth. TrueTime gives you that.

You can read more about the use case in our blog post.

In a recent conference talk, we explained how the full NTP implementation works with Rx. Check the video and slides out for implementation details.

Also, once we have this information it’s valid until the next time you boot your device. This means if you enable the disk caching feature, after a single successful NTP request you can use the information on disk directly without ever making another network request. This applies even across application kills which can happen frequently if your users have a memory starved device.

Overview

  • Pricing: Free
  • Resource Link: https://github.com/instacart/truetime-android
  • Resource Maker: Instacart
  • Mobile Platform Destination: Android Apps
  • Mobile Platform Support: Native Android
  • Programming Languages: Java
  • Gradle: com.github.instacart.truetime-android:library-extension-rx: