简体   繁体   中英

how to access http://schemas.android.com/apk/res/android?

When developing android, we usually use xml when developing a layout file.

example)

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
...

I have a query at that point. How to access http://schemas.android.com/apk/res/android ?

As I found some information. I know that is not a URL, it is URI. So can not access through the internet. Then where is namespace information? How can access that information?

The following URI is a namespace name , according to Namespaces in XML 1.0 (Third Edition) .

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

In section 3 Declaring Namespaces , it is stated that:

The namespace name, to serve its intended purpose, SHOULD have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists).

Some XMLs have no schema. In such XMLs, you can't have it.

The goal of namespace names is to avoid collisions in element names and attribute names. XMLs use URIs as namespace names for their uniqueness and persistence.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM