10. Tablets, Fragments, and Action Bars, Oh My

With the release of Honeycomb and Ice Cream Sandwich, Google has introduced a totally new form factor to the Android landscape. In Gingerbread and earlier, Google had sought to handle only small handset screens. With these new versions of Android, you now must deal with the much larger screens of tablets.

Google has introduced the concept of the fragment (to handle the extra screen real estate and to maintain compatibility with smaller, phone-sized screens) and the action bar (to replace the options menu).

Fragments

Fragments, conceptually, are like activities with a slightly more complex lifecycle. They can be given a screen to themselves if there isn’t much room, or they can be placed with many ...

Get Creating Android Applications: Develop and Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.