Snehal Masne
Snehal Masne

Reputation: 3429

Why are Android app updates/patches sizes are like its setup files?

I was just wondering the same when try to update from PlayStore.

Generally, say for Windows, when it is updated, downloads the files and patches them. From size perspective, these are significantly small compared to its setup which is around 3.5 GB.

So why its not applicable for ANDROID apps? E.g. any update to WhatsApp is almost equivalent to its original setup file (~18 MB).

Upvotes: 5

Views: 1181

Answers (2)

Ravi K Thapliyal
Ravi K Thapliyal

Reputation: 51711

Although Play Store calls them updates, you actually download the whole Android app again. In a way, it's still an update because you do actually upgrade to a newer apk version but not quite the way you would've liked. It's taxing on your bandwidth but it's easy.

However, your app's settings (shared preferences) and data (SQLite databases or custom files) survive this update/install process which won't be the case if you manually uninstall & install the app's new version again.

In cases where the app's database schema has evolved between the two versions, Android notifies the app on startup that it wasn't a fresh install by calling a life cycle method onUpgrade() where the app has a chance to upgrade its data left over by the previous version.

When you compare this with Windows, both the OS and the update server are from Microsoft and they must have worked together to figure out what needs to be pushed (.dll, .ini, .sys etc.), update bundle's format/compression and security implications (some sort of encryption to prevent malware injection by any one intercepting the traffic).

No such standard update mechanism has been made available by Google for the Play Store see update and I believe so is the case with every other app store. Obviously, the developers can't roll out one on their own since the updates are handled by Google both at the device and server side.

But, the developers are certainly not unhappy about it. It's much more convenient to test the new apk, see it working and uploading the same rather than fiddling with what changes to push and breaking the app if you miss something. The bandwidth is cheap anyway.


I've just recently discovered that at Google I/O 2012 Google announced that they were working on a Smart Updates technology using some delta encoding algorithm. The idea was to compute the DIFF between two APKs (sort of like we do for text between two source code files), create a patch on the server-side and only send that over the wire.

This feature went live on Play Store later that year as reported by AndroidPolice and TechCrunch.

Developers, Google said at I/O, won’t have to do anything to enable this feature and according to the folks over at Android Police, this feature quietly went live late last night or early this morning.

You can see it in action in this video. Notice how the apps start installing once the progress bar hits just 40-50%. This is absolutely brilliant because not only this saves Google terabytes of bandwidth, its pure server-side approach means developers don't have to fiddle with anything. Perhaps, that's the reason it finds no mention on the android developers site and so takes time to get discovered.


With that said, my personal experience seems to coincide with yours. I see most of my app updates download almost the whole of the app. Maybe it's because I don't download very frequently. It's not unusual for me to skip several minor revisions and perhaps the app changes far too much to derive any size benefits out of the patch generated.

Upvotes: 6

shelll
shelll

Reputation: 3373

There is nothing like an "update" for an Android app. It is always a full app. It is called update, because it is a new version of the app currently installed in a device.

But when it is an "update" the whole app is not fully downloaded. For many years the Google Play downloads just parts of the app and patches the currently installed app with the difference. So in the case of 20MiB the Google Play can download just few megabytes to reconsctruct the new version in a phone. Google calls is Smart App Updates or something like that.

Upvotes: 0

Related Questions