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

Chapter 6. Android User Interface > Alternative Resources

6.10. Alternative Resources

Android supports multiple competing sets of resources. For example, you could have multiple versions of a strings.xml file, status.xml layout, or background.png image. You might want multiple versions of the same resource so that the best version can be used under different circumstances. We touched on this in Section 6.9.1.

Imagine that your application is used in another country with a different language. In that case, you could provide a strings.xml version specifically for that language. Or imagine that a user runs your application on a different device, with a different screen that has more pixels. In that case, you’d want versions of your images specifically for this screen’s pixel density. Similarly, users might simply rotate the device from portrait to landscape mode. Our application will redraw properly, but there are further enhancements we could make to the layout of the UI given the orientation of the screen.


  

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