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

1

5

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?

Convince answered 19/9, 2020 at 14:51 Comment(4)
Do you want to access to RelativeLayout in your code I am right?Assist
"How to access schemas.android.com/apk/res/android ? -- you don't. There has never been a Web page at that URL. "Then where is namespace information?" -- what do you mean by "namespace information"?Droplight
This may help: #7119859Crescin
The namespace defines the attribute names within the XML. If you are looking for information as to their use you might look at the XML Attributes and Inherited XML attributes sections in the Android API reference. e.g. TextView#xml-attributesLoad
S
6

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.

Staats answered 22/9, 2020 at 16:7 Comment(1)
Thank you for your comment.Convince

© 2022 - 2024 — McMap. All rights reserved.