google에서는 android support library사용을 추천한다. 이를 사용함으로써 많은 버전의 안드로이드 기기들이 app을 사용가능하게 되기 때문이다. 이는 file->project structure를 통해 나오는 관리창의 dependencies항목에서 추가 가능하다.
When you develop an app on a latest version of android like 5.x and you also want it to run on those devices which are running older versions of android like 3.2 e.t.c. you can’t do that until you add backward compatibility to your code.
To provide this backward compatibility android provides you the Android Support Library package. The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level.
Including the Support Libraries in your Android project is considered a best practice for application developers, depending on the range of platform versions your app is targeting and the APIs that it uses.
Support Library Features
The Android Support Library package contains several libraries that can be included in your application. Each of these libraries supports a specific range of Android platform versions and set of features.
In order to effectively use the libraries, it is important to consider that which API level you want to target as each library supports different API level.
Following is a brief description of android support libraries and API level they support.
Downloading the Support Libraries
Please note that before installing the support library packages you should be clear that what feature you want to use in your app.
The Android Support Library package is available through the Android SDK Manager.
Follow the following steps to download the support library package through the SDK Manager.
Start the android SDK Manager.
In the SDK Manager window, scroll to the end of the Packages list, find the Extras folder.
Select the Android Support Library item.
Click the Install packages button.
After downloading, the tool installs the Support Library files to your existing Android SDK directory. The library files are located in the following subdirectory of your SDK: /extras/android/support/ directory.
Choosing Support Libraries
Before adding a Support Library to your application, decide what features you want to include and the lowest Android versions you want to support.
Changes in Android build.gradle
If you are increasing the backward compatibility of your existing application to an earlier version of the Android API with the Support Library, make sure to update your application’s build.gradle. Specifically, you should update the compileSdkVersion element in the build.gradle to the new, lower version number, as shown below −