Yesterday, I was a master's intern at iOS, cough cough. I was puzzled by this question, so I searched for information. Finally, only two authoritative links were found. Based on these two authoritative links, the following is compiled:
ios app contains all versions.
Before ios9, we downloaded and installed all versions of the application. This means that no matter what pictures and resources your phone needs from the app, all screen size pictures and resources will be downloaded.
Think about how much it is:
- Non retina 3.5”
- Retina 3.5”
- Retina 4”, 4.7”, 5.5”
- Non retina iPad full size and Mini
- Retina full size, Mini and Pro
These versions of the pictures and resources add up a lot. Plus also includes 64-bit and 32-bit.
Android extensible layout and pictures
Android, on the other hand, utilizes scalable layouts, and the layout of resources can be expanded to any size, so only one copy is needed. Only the icon file will have many copies, but in the end it will only be 5 times (we basically only have 2 times now, xhdpi and xxhdpi).
ps: In iOS 9, Apple launched App Thinning, which means the App Store will only download the resources required for your device.
Difference between ios and Android
The UI definition file of iPhone (.XIB) is much larger than the XML file used in Android.
Code encryption takes up more space in IOS than Android.
Other possible reasons
In addition, some people speculate that Android applications can run in virtual machines, while iOS is closer to hardware, resulting in a lot of code that can be handed over to the underlying layer when the application is compiled. Of course, this guess is just a guess and is not authoritative.
Possibly (not sure) the IOS includes reference libraries in the application package.
In android, you can save the image in 3 separate folders for different configurations (ldpi, hdpi, mdpi).
It may be that Android selects apt file during installation, without including all files.
Different development platforms are different. Many Android development platforms can create an apk file. When executing it in our mobile phone, the program runs on the virtual machine. When packaging different development platforms of ios, it is necessary to consider that the package must be compiled by x-code, so there are many more files in the package. (This reason feels a bit nonsense)