Difference between support and appcompat support libraries

我们两清 提交于 2020-06-28 01:50:45

问题


I see some examples use compile 'com.android.support:appcompat-v7:21.0.3'

and some show: compile 'com.android.support:support-v7:21.0.3'

What is the difference between these two libraries?


回答1:


v4 support library

This library is designed to be used with Android 1.6 (API level 4) and higher. It includes the largest set of APIs compared to the other libraries, including support for application components, user interface features, accessibility, data handling, network connectivity, and programming utilities.

v7 appcompat library

This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations.

Note: This library depends on the v4 Support Library. If you are using Ant or Eclipse, make sure you include the v4 Support Library as part of this library's classpath.

Source: https://developer.android.com/tools/support-library/features.html




回答2:


AppCompat (At first ActionBarCompat) started out as a backport of the Android 4.0 ActionBar API for devices running on Gingerbread, providing a common API layer on top of the backported implementation and the framework implementation. AppCompat v21+ delivers an API and feature-set that is up-to-date with Android 5.0 like some material styles and themes as well as some Android 5 components like cardview and palette library.

As you can see AppCompat is mostly about making new android app design concept available in older versions.

Support Library on the other hand tries to provide functionalities of new version of android in older versions like fragments. It also has some useful classes which are not present in any version of android like ViewPager, LruCache and LocalBroadcastManager.



来源:https://stackoverflow.com/questions/30418215/difference-between-support-and-appcompat-support-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!