XML in Android Development
In Android Development, as I have already said, you use two languages (mostly), Java and XML. Java is used to make things happen while XML lays everything out.
XML looks like HTML at first sight but then when you notice that there’s no HTML tag you start to get worried. XML and HTML work in tags:
“html’ “/html’ (replace the ” with < and ‘ with >)
The first one opens the tag, the second one closes it.
In Android, XML lays out two different types of things: 1. The layout of each screen (Activity) 2. The layout of the app itself in the AndroidManifest.xml.
The layout of each screen starts with your common <?xml> tag and then after that the tags are used as parents and children. The “LinearLayout” tag might come first (the parent) and then inside it would be its children, say an “EditText” tag (a text box) or a “Button”. Then because it is XML, you can add attributes which go inside the tag. These will describe what the object will look like: android:gravity=”center” would make it in the middle of the screen.
The AndroidManifest.xml is something slightly different. This states all of the Activities in the app and the “intents”. Intents tell the user before they install the app that it will use certain permissions (maybe accessing the internet).
I hope this tells you something new!