Building Adaptive Android Apps with Fragments

with David Gassner
please wait ...
Building Adaptive Android Apps with Fragments
Video duration: 0s 2h 8m Intermediate


One of the most common issues Android developers face is market fragmentation: the variations in screen size and pixel density among the thousands of phones, tablets, and even desktop computers that run Android. The Fragments API (introduced in Android 3.0) helps you deal with this issue. This course teaches Android developers how to program with the Fragments API, and build apps that work well on a wide variety of devices. David Gassner shows how to define different fragment layouts and add them to activities with XML or Java, create layouts for different screens and use a resource alias to select the right layout at runtime, and communicate between activities and fragments. He'll also show you how to make fragments work on older versions of Android, with the support library, and use fragments to display dialogs and preference screens.

Topics include:
  • Understanding fragments
  • Adding fragments to activities
  • Creating layouts for multiple screens
  • Understanding arguments and callback methods
  • Updating apps with support for fragments


- [Voiceover] My name is David Gassner and this is Building Adaptive Android Apps with Fragments. This course is for Android developers who want to build apps that can adapt themselves to screens with different dimensions and pixel densities. Working in the new Android Studio, I'll first introduce you to the Fragments API. I'll describe how to define a fragment's layout and how to add it to an activity with XML or Java. I'll then show you how to define multiple layouts for different screens, how to use resource aliases to select layouts at run time, and how to pass data back and forth between activities and fragments with arguments and callback methods.

I'll also describe the support library to make fragments work on older versions of Android and show you how to manage shared preference screens and dialogues with fragments. The Fragments API is an important part of any Android developers toolkit. I hope this course helps you get started building apps that look great on a wide variety of devices.

please wait ...