An image for static asset selection.

Static asset selection

Published: August 14th, 2014

Read the documentation

Let Cascades choose the best assets for your app

With the wide range of BlackBerry 10 devices and their various screen sizes and resolutions, it's more important than ever to make sure that your app looks great on all of them. This article explains the static asset selection feature and why it's so effective.

Cascades includes several features that make it easier to develop apps for different screen sizes, resolutions, and visual styles. Adaptable layouts let you arrange UI controls in a dynamic and flexible way. API level 10.3 introduced design units, a resolution-independent unit of measurement that corresponds to a different number of pixels depending on the device that the app runs on (check out our recent article to learn more).

You can also use static asset selection, which automatically chooses the best assets (image assets and .qml files) for a particular device. You don't even need to rebuild or repackage your app; Cascades automatically selects the best set of assets for a particular device at runtime. This feature lets you create images and QML code that are designed for a specific resolution, pixel density, or theme, and use them automatically when you build your project.

Screen showing an example of the folder structure for static asset selection.

Static asset selection has been around since the early days of Cascades and BlackBerry 10. In API level 10.3, we improved and expanded the feature, increasing the number of selectors that you can use. For example, you can now select assets based on layouts. Each selector has a syntax that you use for the asset folder names in your project, and you can mix and match multiple selectors in the same project.

Here's a quick summary of the selectors that are available:

To learn more techniques for making your app resolution-independent, see Resolution independence.