Junior — Middle
Have you used XML format markup for structuring data?
sobes.tech AI
Answer from AI
Yes, in Android development, XML is widely used for describing user interfaces, resources, and configurations. For example, layout files in the res/layout folder describe the arrangement and properties of UI elements such as buttons, text fields, etc. This allows separating the application's logic from its visual presentation.
A simple example of a layout in XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, world!" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Press me" />
</LinearLayout>