O'Reilly logo

Flash Development for Android Cookbook by Joseph Labrecque

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scaling visual elements across devices at runtime

The wide variety of Pixels Per Inch (PPI) measurements and overall screen resolution differences across Android devices can make it difficult to make sizing and layout decisions when creating visual elements, especially interactive elements, as these must be large enough for users to touch with their fingertips easily. It is generally accepted that a physical measurement of a half inch square is ideal for proper touch. In this recipe, we will demonstrate how to ensure the same physical specifications across devices.

How to do it…

We will create some visual elements on the screen that are sized to physical measurements based upon the detected device display PPI:

  1. First, import the following classes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required