Google has launched a new API for Android called TrustedTime, which mandates hardware time synchronization with Google’s servers at intervals to ensure the accuracy of the time on the hardware.
According to Google, there are numerous apps currently that rely on accurate time references. For instance, calendar schedules, financial apps, delivery tracking apps, online games, and security apps that require precise timing to generate OTP codes for 2FA. However, referencing time on the device may lead to errors, whether unintentional (accidentally changing the time on the device, faulty device clocks) or intentional (manipulating the time to deceive).
The TrustedTime API is designed to address this issue. It is integrated into Google Play Services and compatible with Android 5.0 and above. App developers can utilize this API within their app development process (import com.google.android.gms.time.TrustedTimeClient) and query the time from TrustedTimeClient when in need of a reliable time value.
One limitation of this API is that an internet connection is required to check time with the server. If the device is offline, requesting time will not return a timestamp.
Source: Android Developers Blog
TLDR: Google introduces TrustedTime API for Android, ensuring accurate time synchronization with Google’s servers, benefiting various apps that rely on precise timing.
Leave a Comment