Chapter 1. Fragments and UI Modularization

This chapter introduces fragments, UI modularization, and the role fragments play in developing a modularized UI. The chapter demonstrates creating simple fragments and using fragments statically within activities.

Let us have a look at the topics to be covered:

  • The need for UI modularization
  • Fragments are the foundation of modularization
  • Support for fragments across Android versions
  • Creating fragments

By the end of this chapter, we will be able to create and use fragments within a static activity layout.

The need for a new approach to UI creation

Chances are that the first class you learned to use when you became an Android developer was the Activity class. After all, the Activity class provided your app with ...

Get Creating Dynamic UI with Android Fragments now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.