2
votes

I recently read about that Google is using File-by-File Patching and another one algorithm BsDiff - Delta update which patches apk files and gives only update sized apk to download from Play Store.

I went through below blogs and links:

1) https://android-developers.googleblog.com/2016/12/saving-data-reducing-the-size-of-app-updates-by-65-percent.html

2) https://github.com/andrewhayden/archive-patcher/blob/master/README.md for "File-by-File Patching"

3) https://android-developers.googleblog.com/2016/07/improvements-for-smaller-app-downloads.html for "BsDiff" patching

I installed BsDiff on my Linux and applied it on old and new apk but it remains the same size of the app and also while I update it on Play Store, it shows full size as at the time of install.

Also, I downloaded "File-by-File Patching" code and made apk through it and updated it on Play Store but the same, no reduced size of apk.

So, If anybody who has done this or know about this, Please give your answer so I can make my app update of reduced size app update on Play Store.

2

2 Answers

3
votes

You don't need to do anything to trigger these APK size reductions for updates. You definitely don't need to download BS Diff or the patching code. Play will do this automatically for you. However some optimizations are applied on demand depending on how popular an app is. So if your app is not very popular it might take a little while to see the advantages.

If you want Google to be able to apply as many optimizations as possible, you should opt in to Google Play App Signing if you haven't already. This gives Google Play the most ability to optimize app updates, and while it doesn't affect these optimizations right now it may in future.

1
votes

There are four different sizes for one APK which are classified as:

  1. Raw Apk Size
  2. Download Size
  3. Install Size
  4. Update Size

You are mostly focusing on Raw Apk size which won't have much difference. Its the google play store which uses different algorithms to compress the APK. This in turn ensure that Download Size of the apk is lower so that the mobile data consumption is reduced for end user.

Once the compressed APK is downloaded it will be uncompressed on the user's device and you will get Install Size. This size can vary from raw size since it will involve some JIT and/or AOT done on it.

When it comes to Update size, you upload the Apk to play store with your update, google play store in turn will compute the delta and deliver it to end user. This delta will then be merged on device. This optimization reduces the update size hence whole APK won't be downloaded again and user will save cost.

To summarize, you might not see big impact on Raw Size of your apk but the optimizations on play store will ensure that Download Size and Upload Size is optimal.

For more details techniques to be applied, you can refer to this article. It gives anatomy of apk sizes as I have described and provides great tips to reduce the sizes.