Understanding the Impact of Including ConstraintLayout Dependency in Android Projects

26 views Asked by At

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

1

There are 1 answers

0
Jaydip Ramani On BEST ANSWER

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.