20.08.2016 Views

Professional Android 4 Application Development

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4Building User Interfaces<br />

WHAT’S IN THIS CHAPTER?<br />

‰ Using Views and layouts<br />

‰ Understanding Fragments<br />

‰ Optimizing layouts<br />

‰ Creating resolution-independent user interfaces<br />

‰ Extending, grouping, creating, and using Views<br />

‰ Using Adapters to bind data to Views<br />

To quote Stephen Fry on the role of style as part of substance in the design of digital devices:<br />

As if a device can function if it has no style. As if a device can be called<br />

stylish that does not function superbly…. Yes, beauty matters. Boy, does it<br />

matter. It is not surface, it is not an extra, it is the thing itself.<br />

—STEPHEN FRY, THE GUARDIAN (OCTOBER 27, 2007)<br />

Although Fry was describing the style of the devices themselves, the same can be said of the<br />

applications that run on them. Bigger, brighter, and higher resolution displays with multitouch<br />

support have made applications increasingly visual. The introduction of devices optimized for<br />

a more immersive experience — including tablets and televisions — into the <strong>Android</strong> ecosystem<br />

has only served to increase the importance of an application’s visual design.<br />

In this chapter you’ll discover the <strong>Android</strong> components used to create UIs. You’ll learn how to<br />

use layouts, Fragments, and Views to create functional and intuitive UIs for your Activities.<br />

The individual elements of an <strong>Android</strong> UI are arranged on screen by means of a variety of<br />

Layout Managers derived from the ViewGroup class. This chapter introduces several native

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!