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.
What does the 'app:layout_constraintBottom_toTopOf' attribute do?
2.
What is the primary purpose of an XML layout file in Android development?
3.
Which layout is commonly used as the root element in an XML layout file?
4.
How can a widget be centered horizontally in ConstraintLayout?
5.
What does 'match_parent' do when assigned to a layout width or height?
6.
What happens if a widget in ConstraintLayout has no constraints?
7.
Which of the following is NOT a recommended unit of measurement in Android layouts?
8.
What is a key advantage of manually editing XML layout files?
9.
Which attribute is used to reference a string resource in an XML layout?
10.
Which statement is true about using XML and the Layout Editor together?
11.
What is the purpose of the 'tools' namespace in XML layouts?
12.
What is an advantage of using the Android Studio Layout Editor over manual XML editing?
13.
Which XML attribute is used to define the width of a widget so that it expands to match its content?
14.
What is the main difference between 'dp' and 'sp' units?