3.7 C
New York
Saturday, February 22, 2025

Google Maps improved obtain reliability by 10% utilizing person initiated information switch API



Google Maps improved obtain reliability by 10% utilizing person initiated information switch API

Posted by Alice Yuan – Developer Relations Engineer, in collaboration with Software program Engineers – Matthew Valgenti and Emma Li – at Google

Google Maps improved obtain reliability by 10% utilizing person initiated information switch API

What’s person initiated information switch?

In Android 14 we launched user-initiated information switch jobs, or UIDT. You should utilize the brand new API setUserInitiated in JobScheduler to specify that the job is a user-initiated information switch job. This API is useful to be used instances that require long-duration (>10 minutes), user-initiated switch of information over community. UIDT can also be an alternate API to utilizing a dataSync foreground service, which has new timeout conduct for apps that concentrate on Android 15.

UIDT is meant to assist person initiated use instances similar to downloading recordsdata from a distant server, importing recordsdata to a distant server or transferring information between two gadgets through Wi-Fi transport. Because the launch of Android 14, the brand new API has been adopted by a rising variety of Android apps working on lots of of thousands and thousands of person gadgets.

What are the advantages if I undertake user-initiated information switch?

The Android staff’s in depth evaluation discovered gaps in foreground providers and WorkManager for lengthy length, person initiated information transfers. Though WorkManager might assist retries and constraints, it couldn’t assist lengthy length work which are sometimes crucial for information switch operations. Builders additionally discovered it difficult to make use of foreground service, which didn’t present a super person expertise throughout interruption of community connectivity.

JobScheduler’s person initiated information switch API helps resolve for these gaps by providing builders the next advantages:

    • Lengthy length, speedy background work execution that isn’t impacted by current job quotas primarily based on app standby buckets.
    • Helps enhance consistency in API conduct throughout all gadgets, and the conduct is enforced via Compatibility Check Suite (CTS).
    • Improved reliability of information switch in comparison with utilizing a foreground service as indicated by Google Maps personal benchmarks.
    • Help for execution when sure constraints are met, similar to working solely on Wi-Fi or solely when the system is charging.
    • Gracefully manages job timeouts and retries.
    • Diminished reminiscence utilization and decreased notification muddle when the app is ready for constraints to be met.

In case you’re trying to do brief or interruptible background work, WorkManager continues to be the really helpful resolution. Take a look at information switch background process choices to be taught extra.

“We successfully launched UIDT on Android 14 in early 2024 migrating from our foreground service implementation. After a retroactive analysis on Android 14 vs Android 13 implementation, we now see a 10%+ improvement in download failure rate of offline downloads!”- Matthew Valgenti, Software Engineer at Google

Google Maps efficiently launched UIDT and noticed enchancment in obtain reliability!

Google Maps determined to make use of UIDT for his or her offline maps obtain use case. This use case ensures that customers are capable of obtain offline maps in order that they have map information even after they lose community connectivity.

What was Google Maps’ major motivation for adopting UIDT?

Google Maps determined to undertake UIDT to make sure that the obtain service works with the newest Android releases and continues to be dependable and environment friendly.

“We applied a number of options and optimizations, similar to resumable downloads in order that if a person’s web connection is interrupted or they exit the app earlier than the obtain is full, the obtain resumes from the place it left off when the person returns to the app or their connection is restored.” – Emma Li, Software program Engineer at Google

What’s the set off level to begin UIDT in Google Maps?

The UIDT is triggered when a person decides to obtain a map area to have that information offline. When a person hits obtain, the UIDT is triggered instantly and processing of the area begins as quickly as doable.

What had been Google Maps’ adoption outcomes?

Google Maps rolled out the venture utilizing experiment flags to grasp metrics affect after every ramp stage.

“We efficiently launched UIDT on Android 14 in early 2024 migrating from our foreground service implementation. After a retroactive evaluation on Android 14 vs Android 13 implementation, we now see a ten%+ enchancment in obtain failure charge of offline downloads!– Matthew Valgenti, Software program Engineer at Google

How do I get began implementing person initiated information switch API?

With a purpose to undertake person initiated information switch, you’ll need to combine with the JobScheduler platform API and gate the change to Android 14 or larger.

Take a look at the next developer documentation to get began with person initiated information switch:

This weblog publish is a part of our sequence: Highlight Week on Android 15, the place we offer assets — weblog posts, movies, pattern code, and extra — all designed that can assist you put together your apps and reap the benefits of the newest options in Android 15. You’ll be able to learn extra within the overview of Highlight Week: Android 15, which will likely be up to date all through the week.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles