When to use support library

前端 未结 4 517
失恋的感觉
失恋的感觉 2021-02-07 10:38

I am confused on the purpose of the Android support library and when it is needed. It is my understanding that the major plus of using the support library is for Android to impl

4条回答
  •  遇见更好的自我
    2021-02-07 10:53

    The Support Library is generally used when you want to easily support a wider range of OS versions with less version specific source - with it you can use features introduced in higher version of the OS on older platforms without having to worry and check whether this platform has that feature and do something in case it doesn't.

    There are several versions of the support library - v4, v7, v8 and v13. They all add functionality that is introduced in the higher versions of the API then the version of the library. For example v4 may add functionality from API 5, 6, 7, 8... , while v7 - only from API 8 and above.

    Other major feature of the libraries is that they are regularly updated so you may choose to depend on the support library for some feature rather than on the current OS version installed (which may introduce bugs in that feature).

    Of course they have their downside too - the support library is an additional dependency for your project.

提交回复
热议问题