How the new Apple TV uses On-Demand Resources to host great apps and games

No, Apple TV apps aren’t limited to 200MB — they use on-demand resources.

Based on a screenshot from Apple’s developer guidelines, there are some folks up in arms about the new Apple TV‘s 200MB limit for app bundles (the app you download from the Apple TV’s App Store).

200MB isn’t a whole lot of storage for game levels, offline content services, or anything really of the sort. The good news is, 200MB is just the size limit for your initial App Store download. Once you open the app, you can download up to 2GB more per app, with up to 20GB of other resources available in the cloud. Apple lets developers do this by using On-Demand Resources, and here’s how it works.

On-Demand Resources 101

Let’s say you, the developer, make a side-scroller app for the Apple TV with 50 levels. All together, your app bundle comes out to be something like 4GB—too much for the Apple TV’s App Store to properly host. Instead, you can take avantage of a new tvOS/iOS feature called On-Demand Resources to slice up your app and deliver it in parts to the user.

Instead of making the user download 4GB off the bat, you slice up your app into a bunch of sections, called tags. You include the essential parts of the app—loading and launch screen, scores, settings, and the first five levels—in that 200MB bundle.

Other levels and assets are split into multiple tags that range in size from 64MB to 512MB. If you sliced up tags that all sized out to 100MB for your game, for instance, you’d have 38 additional items for download once a user installs the game. Those don’t come all at once, however: They’re called on-demand, when a user needs them.

How On-Demand Resources work in action

When a user downloads your app, they’re downloading that initial 200MB app bundle, with all the basics held within it. From there, developers can also mark up to 2GB in initial install tags for download upon install—this means that when a user finishes installing and opens the app, they can get up to two additional gigabytes worth of resources in the background.

In our scenario above, the initial 200MB bundle might just be your game’s launch screen and the like; once a user opens your app for the first time, however, it would call an additional 2GB that included the first 25 levels.

At this point, your game is using 2.2GB of data—2GB of on-demand resources, locally downloaded, plus the other 200MB from the original app bundle. This is the true storage number that the Apple TV supports at any one time: 2.2GB.

But: You have a 4GB game! How do you get those other 25 levels?

Easily, thanks to the power of background processing. On-Demand Resources works in conjunction with whatever your user is actively accessing, and will flush older, unused content to make room for additional resources. If a user is playing level 24 of your game, the system automatically flushes a few 100MB tags of old levels (say, 1-5) to make room for levels 25-30. As the user gets further into your game, older levels drop off and get deleted from the Apple TV, and your new levels (also in tag bundles) get installed—all in the background.

You can host up to 20GB of On-Demand Resources on the Apple TV’s App Store. Though our hypothetical game may only take up 4GB, the 20GB offers a lot of potential for other, more complex games and apps.

TL;DR: There’s a lot of potential for games and apps on the store

To to recap: 200MB is the initial app bundle. 2.2GB is how much space an app can take up at any one point. 20GB is the maximum amount of Apple-hosted resources you can have for any one app.

In contrast, iOS allows up to 2GB for an initial app bundle, with another 2GB available in tags, for a total of 4GB in space per app. So the Apple TV is working with less space than iOS, yes. But it’s not hampered to 200MB apps.

Many thanks to Apple’s excellent developer documentation on On-Demand Resources for helping straighten this out. Any other questions about this? Let me know in the comments and I’ll try to sort it out.

Source: iMore

Meet the Author


0 comments… add one

Leave a Comment