androidandroid-constraintlayout

Understanding the Impact of Including ConstraintLayout Dependency in Android Projects


I'm using constraintlayout to design my activity:

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".SettingsActivity">
...

Acording documentation I need to include implementation line in dependencies section in build.gradle file:

implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

But I don't see any difference in having or not having implementation line in my build.gradle file. Project runs fine in both cases. Why?

P.S. I do Sync now in both cases


Solution

  • Before Android adopted androidx, developers had to include the constraintlayout library separately, but now, constraintlayout is integrated within androidx, eliminating the need for additional library imports.