Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

5. Reusable UI > Using Fragments

Using Fragments

When Android made the jump from phones to tablets, Google had to redesign the architecture of applications because Android’s existing UI elements were insufficient to create the type of information-rich interfaces required by tablets. To address this issue, Google introduced the fragments framework in Android 3.0. Fragments provide a method for decomposing your UI into its constituent parts so that each may be presented in a manner that is right for the device it’s running on (Figure 5.1). On a phone, the list view would consume the whole screen, and tapping an item would take the user to a new screen presenting content. But on a tablet, the list view is simply a part of the display, with the content being displayed simultaneously. As you can see in Figure 5.1, the list view and the content are each contained in a fragment.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint