Is there any Android XML documentation?

17,209

Solution 1

The classes which have XML attributes, list them XML attributes in their own documentation. Attributes beginning with layout are documented in the containing layout class.

The manifest file is documented here. Google recently added a lot of new documentation, including documentation on XML resources. See this webpage on drawable resources.

There resources aren't comprehensive, so R.styleable is still often the best bet. R.attr is better if you just want to see all attributes, rather than the attributes available for a particular tag.

Solution 2

I've wondered this several times too. Best I can figure there isn't any real documentation on this stuff.

I've mostly been just going through the source the SDK gives us so that I could figure out how they did it. The files in $SDK_PATH/platforms/android-1.5/data/res/ should show you how pretty much everything was done for the base system. It isn't easy and it isn't documentation, but it IS examples.

Solution 3

Here's a (200-page) start:

http://developer.android.com/reference/android/R.styleable.html

Solution 4

In the specific View documentation you can find the XML attributes.

Quoting Android reference:

"The best place to find properties that apply to a specific View is the corresponding class reference, which lists all of the supported XML attributes. For example, all of the attributes listed in the table of TextView XML attributes can be used in a style definition for a TextView element (or one of its subclasses).

http://developer.android.com/guide/topics/ui/themes.html

Tip: Look at the Summary of the object's documentation (at the top) and click on XML Attrs to jump directly to the XML attributes.

And for a complete list of properties: R.attr

Share:
17,209
Eddified
Author by

Eddified

SOreadytohelp

Updated on June 03, 2022

Comments

  • Eddified
    Eddified almost 2 years

    Is there any sort of xml reference?

    I found this which turned out to be invaluable for me

    But I can't figure out how I was supposed to know how to do that, had I not found that post.

    I know that the api reference has xml attributes listed for many of the classes... but what about xml tags? Where is it documented that I could build a shape using <padding>, <corners>, <solid> tags?

    I'd really like to know where I can find such documentation.

  • Snicolas
    Snicolas about 11 years
    The web page documenting drawable resources is now obsolete. XML resources are now well documented.