O'Reilly logo

Android User Interface Development by Jason Morris

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

Time for action - coding the scientific layout

The landscape layout is broken into various sub-layouts in order to maintain IDs for the two individual functional areas: Scientific functions and standard functions. Maintaining these with their own ID values allows much easier detection of the available functionality from the Java code. Instead of the Java code deciding on the available functionality based on the configuration, it can use findViewById and test for null to check if the scientific functionality is available. This is not unlike "capability testing" in JavaScript (as apposed to inspection).

  1. Create a new resource directory named res/layout-land.
  2. Create a new layout resource XML file in the layout-land directory named main.xml and open ...

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