Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what's the story with the android XML namespace?

When you first use a name from the android XML namespace, you have to say where to find it, with an attribute in XML like this:

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

However, that URL is a 404 - nothing found there.

The android: namespace is actually included under the locally-installed SDK.

So what's going on here? Why do I need to include a dead URL? Why doesn't the build system pick it up from the SDK like all the other libraries?

Thanks, just looking for the back story on this.

Peter

like image 980
Peter vdL Avatar asked Dec 17 '22 00:12

Peter vdL


1 Answers

This is one of the bad design decisions in XML, the reason for using URIs was that it would be easy to guarantee that they were unique. This is the design flaw, users expect for them to point somewhere to locate something. They don't in this case.

The fact that they can be used for locating resources is kind of incidental. When you realize that they are just unique strings then including the definition files in a different SDK becomes totally natural.

like image 150
Ukko Avatar answered Dec 26 '22 20:12

Ukko