Create Flexible Android UIs with Fragments First introduced in
Android 3.0 (Honeycomb), the Fragment API is now available on
all current Android platform versions via a compatibility
package provided by Google. This library makes using the new
Fragment API an effective way to develop flexible user
interfaces for Android. Read on to learn how to use Fragments in
your applications, including those written to API Level 4
(Android 1.6) and up. What Is an Android Fragment? Before we
begin, let's talk a bit about what fragments are. Obviously,
they are a new type of Android Java object with the Fragment
API. But what are they for? Traditionally, Android applications
have been made up of two basic components: a layout (the screen
contents) and an associated Activity class (that comprises the
functions and handles any data processing and lifecycle events
for that screen). The Android fragment is a new concept that
basically decouples, or loosens, the relationship between the
layout visual details and the activity. To