Using Scalable Graphics Assets

Earlier in this chapter you were introduced to a number of Drawable resources, most of which can be defined in XML and all of which can be scaled smoothly by the run time, regardless of the screen size or pixel density.

Where possible, use the following Drawable resources rather than fixed bitmap assets:

> NinePatches

> Shape Drawables

> Gradient Drawables

V Composite and transformative Drawables such as:

V Rotate and Scale Drawables

V LevelListDrawables

V StateListDrawables

Remember when defining these assets to use density-independent pixels (dp).

Using scalable assets has the advantage of generic support for arbitrary screen sizes and resolutions, with the framework dynamically scaling your assets to produce the best possible image quality.

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment