Programing

android-support-v7-appcompat와 android-support-v4의 차이점

lottogame 2020. 6. 16. 21:35
반응형

android-support-v7-appcompat와 android-support-v4의 차이점


android-support-v4.jarandroid-support-v7-appcompat.jar 의 차이점을 알고 싶었 습니다 . 내 응용 프로그램에 appcompat 작업 표시 줄을 추가하려면 android-support-v7-appcompat.jarandroid-support-v4.jar 또는 android-support-v7-appcompat.jar추가해야합니다 .

또한 android-support-v13.jar 에 appcompat가 있습니까?


최신 정보

이 질문에 대한 답변이 제공되었으므로 지원 라이브러리에 많은 변경이있었습니다. 좋은 점은 매우 잘 문서화되어 있다는 것입니다. 따라서 자세한 내용과 사용 가능한 지원 라이브러리에 대해서는 지원 라이브러리 설명서읽어야합니다 .

지원 라이브러리 릴리스 26.0.0 (2017 년 7 월)부터 대부분의 지원 라이브러리에서 지원되는 최소 API 레벨이 대부분의 라이브러리 패키지에서 Android 4.0 (API 레벨 14)으로 증가했습니다.


다음은 지원 라이브러리 패키지 와의 차이점입니다 .

v4 지원 라이브러리

이 라이브러리는 Android 1.6 (API 레벨 4) Android 2.3 (API 레벨 9) Android 4.0 (API 레벨 14) 이상에서 사용하도록 설계되었습니다 . 여기에는 응용 프로그램 구성 요소, 사용자 인터페이스 기능, 접근성, 데이터 처리, 네트워크 연결 및 프로그래밍 유틸리티에 대한 지원을 포함하여 다른 라이브러리에 비해 가장 큰 API 세트가 포함됩니다.

v7 라이브러리

Android 2.1 (API 레벨 7) Android 2.3 (API 레벨 9) Android 4.0 (API 레벨 14) 이상에서 사용하도록 설계된 여러 라이브러리가 있습니다 . 이러한 라이브러리는 특정 기능 세트를 제공하며 서로 독립적으로 애플리케이션에 포함될 수 있습니다.

v7 appcompat 라이브러리

이 라이브러리는 작업 표시 줄 사용자 인터페이스 디자인 패턴에 대한 지원을 추가합니다.

참고 : 이 라이브러리는 v4 지원 라이브러리에 따라 다릅니다. Ant 또는 Eclipse를 사용중인 경우이 라이브러리의 클래스 경로의 일부로 v4 지원 라이브러리를 포함시켜야합니다.

v7을 사용하려면 두 항아리가 모두 필요합니다.


android-support-v13.jar 업데이트

v13 지원 라이브러리

이 인터페이스는 API 레벨 27.1.0에서 더 이상 사용되지 않습니다. 프레임 워크 Fragment 대신 Fragment사용하십시오 .

v13 지원 라이브러리

이 라이브러리는 Android 3.2 (API 레벨 13) 이상에서 사용하도록 설계되었습니다. (FragmentCompat) 클래스 및 추가 조각 지원 클래스를 사용하여 Fragment 사용자 인터페이스 패턴에 대한 지원을 추가합니다.

패키지 세부 정보가 표시되면 정의에 지정된대로 FragmentCompat 클래스가 있습니다. 따라서 appcompat 라이브러리의 모든 클래스가 없습니다.


지원 라이브러리 란 무엇입니까?

지원 라이브러리는 코드 라이브러리 (클래스 모음)로, 기존 장치에서 작동하도록 새로 추가 된 기능을 만듭니다.
예를 들어, 재질 디자인은 API (21)에 도입 (안드로이드 5.0 - Lolipop)했지만 V7 지원 라이브러리 API 7 (안드로이드 2.1.x의 -Eclair) 이상에이를 사용할 수 있습니다.

다른 지원 라이브러리는 무엇입니까?

주요 지원 라이브러리 중 일부는

  • V4 지원 라이브러리

  • V7 지원 라이브러리

  • V8 지원 라이브러리

  • v13 지원 라이브러리

v7 지원 라이브러리에서 7의 의미는 무엇입니까?

이는이 라이브러리에 API 레벨 7 이상에서 사용하도록 설계된 기능이 있음을 의미합니다. V4 (API 4 이상을위한 기능 포함)도 마찬가지입니다.

v7 지원 라이브러리와 v7 appcompat 라이브러리의 차이점은 무엇입니까?

저를 포함한 몇몇 사람들은이 두 용어를 혼동합니다. 실제로 v7 appcompat 라이브러리는 v7 지원 라이브러리의 일부입니다. v7 지원 라이브러리는 주로 API 7 이상에 대한 머티리얼 디자인 및 ActionBar 디자인 패턴을 지원하도록 개발되었습니다.
V7은 더 많은 하위 범주로 분류 될 수 있습니다

  • v7 appcompat 라이브러리

  • v7 cardView 라이브러리

  • v7 recyclerView 라이브러리
  • v7 팔레트 라이브러리 등

v7 appcompat 라이브러리에는 다음과 같은 주요 클래스 인 ActionBar, ActionBarActivity, ShareActionProvider가 있습니다.

추가하면

com.android.support:appcompat-v7:21.0.+

gradle 파일의 종속성으로 인해 위에서 언급 한 클래스를 가져옵니다.

보너스

다른 지원 라이브러리

멀티 덱스 지원 라이브러리 (65k 이상의 방법으로 앱을 만들 때)
v17 Leanback 지원 라이브러리 (Android TV에 중요한 위젯을 제공하는 지원 라이브러리)

관련 링크


최소 SDK 버전이 API 레벨 11 미만인 경우에만 지원 라이브러리가 필요합니다. 그렇지 않으면 Api 레벨 11 이상의 프로젝트에 지원 라이브러리를 추가 할 필요가 없습니다.

android-support-v4.jar :android.app Android API 레벨 4 이상을위한 애플리케이션 개발을 지원하는 클래스를 지원합니다. 따라서 응용 프로그램 백 워드를 호환 가능하게 만들 수 있습니다.

android-support-v7.jar It is recently added in latest support library updation. ActionBar to allow implementation of the action bar user interface design pattern back to Android 2.1 (API level 7) and higher. Use of this class requires that you implement your activity by extending the new ActionBarActivity class.

If I want to add appcompat action bar in my application do I need to add both android-support-v7-appcompat.jar and android-support-v4.jar or only android-support-v7-appcompat.jar.

Yes you need to add reference of both libraries if you want to use it.

does android-support-v13.jar has appcompat?

No, It includes FragmentCompat so that if some of the Fragment feature add added after version 13 than you can make it backword compatible to Api level 11. so that Application targeting API 11 or greater can use feature which added on newer versions.


First, we need to understand, What is the Android Support Library?

The Android Support Library was originally released in 2011, You can say that as the Android Compatibility Library.the Android Support Library provides newer APIs for older releases.but the story is not enough.

this can be little confusing that support libraries with higher version numbers include the features from previous libraries (you might think v7-appcompat improves upon and includes all features from v4). In most cases, this is incorrect.but libraries themselves have a revision number. For example, “AppCompat v21” actually refers to support library v7-appcompat, revision 21.

The Android Support Library is not a single library but it can roughly be divided into two groups: compatibility and component libraries.

1-Compatibility Libraries focus on backporting features from newer framework releases so that devices running previous releases can take advantage of the newer APIs. The major compatibility libraries are v4 and v7-appcompat.

v4 library: It includes many features and, as its name suggests, supports back to API 4. In addition, to support implementations for major classes like Fragment and Loader (which were both introduced in the framework in API 11), you’ll also find several widely-used classes not present in the framework at all, such as ViewPager and DrawerLayout.

v7-appcompat: the v7-appcompat library provides support implementations for ActionBar (introduced in API 11) and Toolbar (introduced in API 21) for releases back to API 7. It requires the v4 library but does not include it. Thus, any feature dependent upon v7-appcompat is also dependent upon v4.

2-Component Libraries the Android Support Library also provides smaller, more modular component libraries that enable developers to add features that are otherwise not part of the standard framework. These self-contained libraries can be easily added or removed from a project without concern for dependencies. There are several valuable component libraries to consider:

v7-recyclerview: provides the RecyclerView component, which efficiently displays and animates large amounts of data and is designed to replace ListView

v7-cardview: provides the CardView component, enabling the cards UI design pattern

v7-gridlayout: provides the GridLayout class, which enables organizing UI elements into a rectangular grid. Etc..

Other Libraries The Android Support Library also contains a few other libraries that are used less often, but still worth mentioning:

v8: provides support for RenderScript (introduced in API 11) back to API 8

v13: provides additional compatibility support for the Fragment UI pattern and bundles the v4 librar

v17: provides support for building TV UIs

When should I use the Android Support Library?

You should use one of the support libraries when you need specific framework features that are newer than the minSdkVersion of your app or that are not available in the standard framework.

and I refer this tutorial


This answer is relevant for clients of support libraries which their version is >= 26.0.0:

Caution: Starting with Support Library release 26.0.0 (July 2017), the minimum supported API level across most support libraries has increased to Android 4.0 (API level 14) for most library packages.

For example, the support-v4 and the support-v7 package both support a minimum API level of 14, for releases of the Support Library from 26.0.0 and higher.

For more information, see Support Library - Version Support and Package Names.

참고URL : https://stackoverflow.com/questions/18271429/difference-between-android-support-v7-appcompat-and-android-support-v4

반응형