Search code examples
androidandroid-support-libraryandroid-constraintlayoutandroidx

Android ConstraintLayout backward compatible to older android version?


I am using Android Studio 3.5 and developing new Android App which must run on Android 4.0 and later.

I want to use ConstraintLayout. Will my app be compatible with Android 4.0?


Solution

  • The minsdk depends by the library used:

    With the support library (the class is android.support.constraint.ConstraintLayout) you can use:

    implementation 'com.android.support.constraint:constraint-layout:1.1.3' --> minSdk=9
    

    With androidx (the class is androidx.constraintlayout.widget.ConstraintLayout) you can use:

    implementation "androidx.constraintlayout:constraintlayout:2.0.0-beta2" --> minSdk=14
    implementation "androidx.constraintlayout:constraintlayout:1.1.3"  --> minSdk=9