0

While using Android Studio, I came across constraint layout. I used the below mentioned link to understand all about it:

https://developer.android.com/reference/android/support/constraint/ConstraintLayout.html#RelativePositioning

but I still have a small question. In RelativeLayout, we use android:layout_alignParentBottom, android:layout_alignParentTop, etc. They all start with android. But in ConstraintLayout, we have to use app:layout_constraintLeft_toRightOf, etc.

Can you explain me the difference between using app and android prefix and their importance?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • because constraint layout is part of the support library, so it's supported resource values have to be added separately. – Sarthak Mittal Jun 13 '17 at 12:37
  • See below links. I hope it helps . [Android Layout - when to use app: vs android:?](https://stackoverflow.com/questions/28045648/android-layout-when-to-use-app-vs-android) [What is the 'app' Android XML namespace?](https://stackoverflow.com/questions/26692233/what-is-the-app-android-xml-namespace) [Difference between android: and app: prefix in Android XML?](https://stackoverflow.com/questions/29732512/difference-between-android-and-app-prefix-in-android-xml) – Vidhi Dave Jun 13 '17 at 12:53

1 Answers1

0

android is usually used for attribute coming from Android SDK itself.

app is often used if you are using the support library.

ConstraintLayout is new layout available in the support library. hence the "app"

Shubham Goel
  • 1,962
  • 17
  • 25