The support library
When it comes to building backwards-compatible applications, the support library is undoubtedly our most powerful tool. It is in fact a series of individual code libraries that work by providing alternative classes and interfaces to those found in the standard APIs.
There are around 12 individual libraries and they do not only provide compatibility; they also include common UI components such as sliding drawers and floating action buttons that would otherwise have to be built from scratch. They can also simplify the process of developing for different screen sizes and shapes, as well as adding one or two miscellaneous functions.
Note
As we are developing with Android Studio, we should download the support repository rather than the support library as the repository is designed specifically for the studio, provides exactly the same functionality, and is more efficient.
In the example we are working on in this chapter, we will not be making any use of support libraries. The only one the project includes is the v7 appcompat library
, which was added automatically for us when we started the project. We will be returning to support libraries often in the book, so for now, we can concentrate on applying our first pattern.