Xmlns: android, how does it work?

Consider the following perfectly-formed layout file on Android:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Hello World, PurpleActivity"/>
</LinearLayout>

I looked at it and fell in love with this ULR: http://schemas.android.com/apk/res/android . So, I tried to enter it in the address bar of a web browser, and also tried to get it through CURL, but both methods showed that it actually does not exist. I was looking for something similar to the apk / res / android directory in the android-sdk folder on my local machine, but this search did not appear either. So, I realized that this resource does not actually exist, it is possible that I can change the xmlns: android string to whatever I want. I went ahead and changed it to

http://schemas.android.com/apk/res/androidASDFASDFASDFASDFLKJSDFLEIE

and then tried to recompile my project. I got this result:

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...
     [aapt]     (skipping hidden file '/Users/rutski/Desktop/purple/res/layout/.#main.xml')
     [aapt] /Users/rutski/Desktop/purple/res/layout/main.xml:2: error: No resource identifier found for attribute 'orientation' in package 'androidASDFASDFASDFASDFLKJSDFLEIE'
     [aapt] /Users/rutski/Desktop/purple/res/layout/main.xml:2: error: No resource identifier found for attribute 'layout_width' in package 'androidASDFASDFASDFASDFLKJSDFLEIE'
     [aapt] /Users/rutski/Desktop/purple/res/layout/main.xml:2: error: No resource identifier found for attribute 'layout_height' in package 'androidASDFASDFASDFASDFLKJSDFLEIE'
     [aapt] /Users/rutski/Desktop/purple/res/layout/main.xml:7: error: No resource identifier found for attribute 'layout_width' in package 'androidASDFASDFASDFASDFLKJSDFLEIE'
     [aapt] /Users/rutski/Desktop/purple/res/layout/main.xml:7: error: No resource identifier found for attribute 'layout_height' in package 'androidASDFASDFASDFASDFLKJSDFLEIE'
     [aapt] /Users/rutski/Desktop/purple/res/layout/main.xml:7: error: No resource identifier found for attribute 'text' in package 'androidASDFASDFASDFASDFLKJSDFLEIE'

. , , xmlns: android - ? , ?

+5
2

xmlns:android="http://schemas.android.com/apk/res/android" XML. xmlns . android . http://schemas.android.com/apk/res/android - URI - , , . URI - ( ); URL-, -.

, . , , android - , .

, : " http://schemas.android.com/apk/res/android , android.

URI, - URI . . , .

+6

, URI. , XML, XML. , . , , .

0

All Articles