1

Hey can you please explain me why we need to set

xmlns:android="http://schemas.android.com/apk/res/android"

in the xml layouts?

Karthick pop
  • 616
  • 3
  • 16

1 Answers1

1

This declares a namespace in xml.

This guarantees that the naming is unique, for example android:id or android:layout_width are id or layout_width, but in the namespace android, so id e.g. can be declared again in another namespace.

It is quite similar with a C# namespace or a java package.

the URI of the namespace is not a valid uri. It is just an unique identifier.

Lukas
  • 196
  • 12