Part 1 .Basics of XML in Android Project

Part 1 .Basics of XML in Android Project

First Blog

ยท

1 min read

"One XML file has only one root tag"

photo_2022-11-17_17-22-21.jpg

So why is this root tag important ๐Ÿ™„

The answer is when we take root tag through layout (just like canvas is used to paint, right... We take layout in order to use View and ViewGroup)
If you want to use lots of View and/or lots of ViewGroup then you have to take a root layout which is ViewGroup in which we can use multiple ViewGroup.
Note :- Every layout is ViewGroup but every ViewGroup need not to be a layout ๐Ÿฅฒ

In Android there are lots of layouts. Here are some Common layouts listed

    Example
  • 1) Linear Layout
  • linearlayout-small.png
  • 2) Relative Layout
  • relativelayout-small.png

  • 3) Web View
  • webview-small.png and more...

But by default in Android Studio we get constraint layout.

photo_2022-11-17_17-22-21.jpg We'll be discussing a brief idea about mandatory attributes of root element and more about layouts in upcoming Part 2.
Till then...
Stay tuned ๐Ÿ˜‰

ย