Chapter 6

Understanding Android Resources

In This Chapter

arrow Knowing why resources are important in Android

arrow Extracting resources

arrow Working with image resources

Resources are mentioned in detail throughout this book, so you might wonder why an entire chapter is devoted to them. Discussing resources and their use in Chapters 3 and 4 is necessary to help you understand the basic structure of the resource directory and the use of resources to build a simple application. One compelling reason to use resources in your application — localization — is covered in this chapter.

Understanding Resources

Resources are additional static content that are an intrinsic part of your app but aren’t part of your Java code. The most common resources are

  • Layout
  • String
  • Image
  • Dimension
  • Style
  • Theme
  • Value
  • Menu
  • Color

Earlier chapters in this book introduce you to layouts, strings, and images because they’re the most common types of resources that you use in everyday Android application development. The remaining resources may need some explanation, so the following few sections will clear them up.

Dimensions

In an Android resource, a dimension is a number followed by a unit of measurement, such as 10px, ...

Get Android App Development For Dummies, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.