This quiz will test your knowledge of creating and editing XML layout files for Android applications. You’ll encounter questions on XML structure, view attributes, constraints, measurement units, and best practices for designing responsive user interfaces. Whether you prefer using the Layout Editor or writing XML manually, this quiz will help reinforce your understanding of Android UI development.
1.
Which of the following is NOT a recommended unit of measurement in Android layouts?
2.
Which XML attribute is used to define the width of a widget so that it expands to match its content?
3.
Which statement is true about using XML and the Layout Editor together?
4.
Which layout is commonly used as the root element in an XML layout file?
5.
What is a key advantage of manually editing XML layout files?
6.
What does 'match_parent' do when assigned to a layout width or height?
7.
What is an advantage of using the Android Studio Layout Editor over manual XML editing?
8.
What does the 'app:layout_constraintBottom_toTopOf' attribute do?
9.
What is the main difference between 'dp' and 'sp' units?
10.
What is the primary purpose of an XML layout file in Android development?
11.
How can a widget be centered horizontally in ConstraintLayout?
12.
What happens if a widget in ConstraintLayout has no constraints?
13.
What is the purpose of the 'tools' namespace in XML layouts?
14.
Which attribute is used to reference a string resource in an XML layout?