WWDC 2015: Apple has reduced the app

If users of iOS devices pay attention to the “nonsense” they would be shocked: beginning in the fall 2015 application for iOS suddenly began to lose weight. As if Apple has a unit of mages, not otherwise.

But users generally to digital prose is not down. Especially owners of devices with 128 or 256 Gigabytes of flash memory. Apple was pretending, for many years. Company (in the days of the first Macs) has been criticized for pandering to the stupid users, claiming that the use of Mac AMI dulls.

But truly serious problems at Apple began in 1995, when Microsoft created something very similar to the Macs system and called it Windows 95. And Mac was still the best, but not spoiled stultifying Mac native interface for PC care.

By the way, don’t you think that users really stupefied in recent years? I do not Mac and there to blame? Today is not our thing, alas. Sometime?

Operating system (any) is, in fact, a huge application consisting of code and resources in especially large sizes. It’s millions of lines of non-trivial source code, and a lot of stuff for different purposes. Fashion slimming touched and iOS.

iOS 8 “weighed” 4.6 Gigabytes. It was the perfect OS that meets the requirements of the time, something even the best in the world, the giant size is understandable and clear.

iOS 9 is not inferior to its predecessor on the part of functionality, on the contrary – she was able to work with a wide variety of devices, while installation took only from 1.3 to 1.8 gigabytes of flash memory.

Magic?

The sequel mini-series about WWDC 2015, previous parts here:

The first part of WWDC 2015: No sensations;
Second part: WWDC 2015: Back to the Mac, iPhone and iPad.

From “overweight”?

iOS application is executable code and resources. In particular, image files. They, as a rule, very much. Graphics adds a the application of brightness and expressiveness, and in order to achieve something of these qualities is absolutely necessary.

Developers graphic formats (such as JPEG, PNG or TIFF) put a lot of effort in the development of image compression algorithms, but when hundreds (or tens of thousands) of locations in the flash memory device, and they take much. The “heavier” application, the more time (and traffic) is required to download it.

With the advent of Retina displays image files in iOS applications have come to occupy a significantly large memory space. Compatibility with Retina displays is added to the application resources graphic files with 2-fold height and width. Of course they are much heavier than 1-fold. Depending on the resolution of the device on which the program runs was used with either 1-fold or 2-fold options.

The size of the executable code is also growing by leaps and bounds: for the application to work on all devices capable of operating in the declared when sending in the App Store, iOS versions, the code was required several times more than before.

The code and graphics were not the only “memory eaters”, there were others: audio, video, anything. The code for Open GL ES code for Metal and the like.

I had to do something, and that something was preparing. In addition, iOS 7 introduces Image Assets (Asset translates as “assets”), to graphic files with specific names (in rows) for different multiplicities of the resolution (columns). On request from the application back files desired permissions

Likely to have taken other measures to prepare for the sweeping changes. Meanwhile, for iPhone 6 Plus took the graphic files are 3 times the size. The same, of course, the number that 1 – and 2-fold. Only more severe.

The problem became unbearable.

How to solve this problem?

I saw (at about the same time) as a similar problem was solved in one of the Store one of the leading manufacturers of phones and tablets for Android. I will not say what, we have worked with several. Store, as well as Apple App Store, carefully check the application and among the requirements was the limitation on the size of the Assembly, significantly smaller than the size of the application, which is not the first housed in Google Play.

In the documentation I found the answer, in essence, “do what you want”. Place all of the resources on your server, and upload them from there, as needed, when the app is installed on the device. Did so.

On the company’s server the place was, no-hassle, no cost, but we have been allocated.

Perhaps the most typical response to innovation Apple: “it’s already done to them many times, nothing new they have not invented”. But the fact of the matter is that, as a rule, the main question is not “what?” and “how?”.

On whose shoulders lie the care of a weight reduction program, one should have a headache for the correct functioning of all this, and who pay for it (not all at hand a vast space unoccupied memory on the server).

The way Apple – to do the right thing (guy Kawasaki)

Apple’s decision was part of iOS 9. Decisions were few, most of the work Apple took over.

The developer, as before, was sent for review and placement in the App Store program with a complete set of all resources required for normal operation on all types of iOS devices.

When the application is installed to the user’s device, automatically, with the participation of the LLVM from the app deleted everything on the target device is not required.

Install only the executable code corresponding to the target device, and only the graphics file the required size. Of those who were located in the Image Assets. All this was done the software App Store.

To Image Assets in iOS 9 added Data Assets, to embed any resources for different device types. They did just as well. In addition to allowing the screen to select what resources were used to set a variety of criteria: the amount of RAM, type of graphics processor and others.

Depending on the technical capabilities of the device on which you installed the app, the App Store automatically selected the correct one.

A developer was another tool: install in parts, and then try to download (from App Store) other parts on request of the application. And when the available memory becomes too small, parts that are no longer used are deleted (on device). An application request the remote side back to her place.

Part of the application (resources, code set in pieces not permitted) denotes its developer, special tags. Tags you can tag individual files or entire folders. The developer can assign one of the parts installed along with the application or to install with your application any of them.

At WWDC as an example, led the game with multiple levels. Most likely, the application installation will be installed the first level when there is a need for a second level request, the application will be downloaded and installed second. With the acute shortage of memory first level (since it is not used longer) will be removed, but on the first request the App Store it will restore.

To be continued

To discuss the history of Apple you can in our Telegram chat.

Leave a Reply

Your email address will not be published. Required fields are marked *