What is the Android Support Library and why should you care?

2015-04-22

Google just released it’s latest update to the Android Support Library and it’s a big one. ActionBarActivity has been deprecated in favor of AppCompatActivity, AppCompatDialog has been introduced and Drawables can now be tinted as well as a heap of other features.

That’s all well and good. But what if you have never heard of the Android Support Libraries? What do they mean to you as a developer?

The Android Support Libraries

The purpose of the Support Libraries is to provide important design patterns and functionality to earlier versions of Android. Take for example the adoption of Material Design in Android Lollipop (v21). If your App is running on a device that is pre-Lollipop then it isn’t going to have the Material Design APIs in the SDK and if you tried to run it then it will most likely crash.

The Support Library solves this problem by providing a subset of the Material Design API and other functions to your App by checking to see if your devices Android version has the various methods it provided.

If it does then it just use the native code in your devices SDK, if it doesn’t then the Support Library will step in and provide the missing pieces. Allowing them to be accessed in your XML Layouts, Styles and Java code.

I do stress the word subset, that is because not everything is available through the Support Library. Somethings just aren’t possible on older versions of Android, due to hardware limitations or even just it isn’t feasible due to the architecture of the Android Operating System.

Why Should I Use The Support Libraries?

People complain that Android has a fragmentation problem, the Support Libraries help nullify those complaints and even to some extent go beyond that.

The guys at Google do an amazing job at back porting functionality to previous versions of Android so you as a developer can continue to support older versions of Android.

Thanks to the Support Libraries you can use Fragments all the way down to Android Donut (1.6/v4). You can adopt main aspects of Material Design into your App on devices as low as Android Eclair (2.1/v7).

If reaching as many users as possible across various versions of Android is your goal. The Android Support Libraries are your go to destination.