Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android API level 21 backward compatibility? (Since the new update of the SDK came out)

I have a problem with the API Level 21. I want to use the Material Design and still be able to run the application on lower API levels like 18 (Android 4.3.1). But I always get that error:enter image description here

My manifest SDK looks like that:

enter image description here

And the build.gradle like that: enter image description here

Hope this is enougth information to get some help, I really need it :(

Cheers.

like image 277
Uchiha Avatar asked Oct 18 '14 09:10

Uchiha


People also ask

What is the latest version API level of the Android SDK?

Android 10 (API level 29) For details about the platform changes, see Android 10 for Developers.

How do you make an Android app backwards compatible?

In order to provide backward compatibility, developers can check at runtime the platform version and use a new API on newer versions of the platform and old API on older versions or, depending on the case, using some static libraries which offer backward compatibility.

What is the SDK version of Android 4.4 2?

The Android Mobile Messaging SDK version 4.4. 2 uses: Minimum API version 19. Compile API version 28.

Is Android 12 backwards compatible?

In addition, Android 12 provides backward compatibility behavior for sticky immersive mode.

What are the different levels of Android SDK?

Android 4.1 (API level 16) Android 4.0.3 (API level 15) Android 4.0 (API level 14) Android 3.2 (API level 13) Android 3.1 (API level 12) Android 3.0 (API level 11) Android 2.3.3 (API level 10) Android 2.3 (API level 9) This page provides release information about the SDK packages available for download from the SDK Manager, ...

What SDK version is required for Android 7?

Initial release for Android 7.1 (API level 25). Released as Android 7.1 Developer Preview 1. For more information, see the Android 7.1 API Overview. Android SDK Platform-Tools 25.0.0 or higher is required.

What is the latest Android version for developers?

Android 7.0 (API level 24) For details about the platform changes, see Android 7.0 for developers. Revision 1 (August 2016) Android 6.0 (API level 23)

What is Android version and API level?

Android versions and API levels. As the Android platform evolves and new Android versions are released, each Android version is assigned a unique integer identifier, called the API Level. Therefore, each Android version corresponds to a single Android API Level.


1 Answers

As described in doc : https://developer.android.com/training/material/theme.html

Note: The material theme is only available in Android 5.0 (API level 21) and above

This means that you have to use the values-v21 folder for your Material Theme.

However you can use the v7 Support Libraries to provide themes with material design styles for some widgets. This is an example, using the AppCompat Theme.

<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">  
    <!-- Here we setting appcompat’s actionBarStyle -->
    <item name="actionBarStyle">@style/MyActionBarStyle</item>

    <!-- ...and here we setting appcompat’s color theming attrs -->
    <item name="colorPrimary">@color/my_awesome_red</item>
    <item name="colorPrimaryDark">@color/my_awesome_darker_red</item>

    <!-- The rest of your attributes -->
</style> 

More info here: https://chris.banes.me/2014/10/17/appcompat-v21/

like image 114
Gabriele Mariotti Avatar answered Oct 07 '22 07:10

Gabriele Mariotti