Google has announced a new method of updating your apps by shrinking the size of Android app updates once again on the Play Store. A previous change had reduced the size of updates by 47% on average by using bsdiff algorithm. Since there were some drawbacks in the earlier technology, Google improved a new approach that reduces file size further by 65% smaller than the full app, and in some cases, more than 90% smaller.
Data pack is one of the major concerns for Android users, especially in developed countries, since a lot of apps go on frequent updates. The new update squeezes overall app size using File-by-File patching – now, when you update your app, Google Play will send your device a patch rather than the entire APK file of the app. The interesting part of this update is that it will save 6 petabytes of user data per day if it deploys a limited file-by-file patching system.
Google’s software engineer Andrew Hayden explains how the new updates will work in the Google Play store.
Android APKs are essentially ZIP archives with a number of special conventions. The contents of such archives are compressed using a technology called Deflate. That makes the archive smaller, but it also makes it very difficult to identify changes from one version to the next. Even a small change can make the compressed archive look completely different. The new approach is called file-by-file patching, and it makes it possible to find the changes and integrate them with the APK on your device.
List of several recent Google updates for popular apps to show how much data is saved with File-by-File patching.
Application Original Size Previous (BSDiff) Patch Size (% vs. original) File-by-File Patch Size (% vs. original)
Farm Heroes Super Saga 71.1 MB 13.4 MB (-81%) 8.0 MB (-89%)
Google Maps 32.7 MB 17.5 MB (-46%) 9.6 MB (-71%)
Gmail 17.8 MB 7.6 MB (-57%) 7.3 MB (-59%)
Google TTS 18.9 MB 17.2 MB (-9%) 13.1 MB (-31%)
Kindle 52.4 MB 19.1 MB (-64%) 8.4 MB (-84%)
Netflix 16.2 MB 7.7 MB (-52%) 1.2 MB (-92%)
Android app updates work similarly to Chrome, Firefox, and Vivaldi updates. It is based on comparing the uncompressed new and old archives. Google identifies the changes, applies the delta to your device’s uncompressed archive, and then re-compress it, making sure that the archive on your smartphone matches the one on the Play Store “byte for byte”. The drawback with file-by-file patching is that your phone has to re-compress the APK, which can take a while on older or slower devices. Google says that it can now handle one megabyte per second. So, shrinking the patch size by half tends to double the time spent.
The automatic updates take place usually at night when your phone is plugged into power and you’re not using it. This ensures that users will not have to wait for more time than usual time for an update to finish when done manually.
However, the File-by-File patching system has been open sourced on GitHub, and anyone can contribute and improve the algorithm’s efficiency.