Android 3.0 introduced the Fragment class, intended to represent a behavior or portion of a user interface in an Activity. Since then, Google has released the Android Compatibility package to extend Fragment support to devices running Android 1.6 or later.
Fragments allow you to decompose the functionality and user interface of an application into reusable modules. You can then implement your Activities to assemble difference combinations of Fragments depending on the screen size and orientation of the device—for example, taking advantage of the large screen size of a tablet while still supporting smaller handheld devices.
However, Fragments provide benefits beyond improving your application’s support for multiple screen sizes. For example, Fragments allow you to:
Ken Jones is a Sr. Technical Trainer at Marakana, Inc., specializing in teaching Android programming and other open source technologies. Ken has thousands of in-class hours presenting advanced technical topics, and over 25 years experience in technical training and documentation targeted towards software developers. Ken has delivered training to various software development teams within the Fortune 1000 such as Cisco, Intel, IBM, Boeing, AT&T, Ericsson/Nokia, and many more.
Comments on this page are now closed.
For information on becoming a sponsor of Android Open, contact Sharon Cordesse at scordesse@oreilly.com
For media partnerships, contact mediapartners@ oreilly.com
For media-related inquiries, contact Maureen Jennings at maureen@oreilly.com
To stay abreast of conference news and to receive email notification when registration opens, please sign up for the Android Open Conference Bulletin
Have an idea for Android Open to share? suggestions@oreilly.com
View a complete list of Android Open contacts
Comments
Very good presentation. Unfortunately I think that there is a mistake on page 8. The code snippet should use: if (savedInstanceState == null) instead of if (savedInstanceState != null) This correction means that a new fragment instance will be only created if no bundle with an existing fragment has been passed in.
Regards, Anguel
Excellent overview of fragments, including many helpful real-world gotchas. Slides clearly described the how-tos of implementation. Thanks!