Basic XML for Android Devs

Introduction:

Tags:

  1. Normal tag
  2. Self closing tag

Normal tag:

Self closing tag:

Attributes:

  • Attribute key
  • Attribute value (it must be wrapped in double quotes)
  • Namespace (optional in xml, but required in android layouts)
<MyTag
namespace:key_one="value1"
namespace:key_two="value2">
</MyTag>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent" />

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sanjay S

Sanjay S

Google Certified Associate Android Developer