Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is AppCompat?

Tags:

android

I want to use Material Design in my app, but my app should be based on Jellybean not Lollipop. So my question is:

  1. I want to use com.android.support:appcompat-v7:23.1.1. Is this a possible solution for my problem?

  2. I want to know more about compileSdkVersion and minSdkVersion: If compileSdkVersion is 20 and minSdkVersion is 18, then, if I use some material design(in Lollipop, sdk20) like fab, cardview. Is it fine if I run my app in jellybean device?(which is SdkVersion 18, same with minSdkVersion)?

like image 719
cliwo Avatar asked Feb 22 '16 12:02

cliwo


People also ask

What does AppCompat mean?

When new versions of android are published, Google will have to support the older versions of android. So AppCompat is a set of support libraries which can be used to make the apps developed with newer versions work with older versions.

What is AppCompat activity in Android?

androidx.appcompat.app.AppCompatActivity. Base class for activities that wish to use some of the newer platform features on older Android devices. Some of these backported features include: Using the action bar, including action items, navigation modes and more with the setSupportActionBar(Toolbar) API.

Is AppCompat necessary?

No, you should always use AppCompat. This ensures that your app is already consistent across all API levels and you have access to all new APIs (such as using the Colored buttons, which was only introduced in API 23). Many other libraries, such as the Design Support Library also require use of AppCompat.

What is AndroidX AppCompat app?

Official Description: The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.


1 Answers

When new versions of android are published, Google will have to support the older versions of android. So AppCompat is a set of support libraries which can be used to make the apps developed with newer versions work with older versions.

For example: When you create an android project with minimum Api level 9, and target api level 21, The newer features like ActionBar, Drawer Menu (Newer in the sense that they were not present in Api 9) etc should also be supported in Api Level 10 phones. Then, you can use the appCompat library. So the android actionbar will become androidsupport actionbar/ supportFragment etc.

like image 192
Vishnu Avatar answered Sep 28 '22 03:09

Vishnu