Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Mobile App 2

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

In a View element in a Layout XML, which two attributes are required?

a)

android:id and android:orientation

b)

android:layout_width and android:layout_height

c)

android:text and android:padding

d)

android:gravity and android:layout_weight

2.

What is android:id mainly used for in Layout XML?

a)

Set the size of a View

b)

Determine the layout orientation

c)

Refer to find a View via findViewById()

d)

Assign display text

3.

Where are layout XML files located in an Android project?

a)

res/layout

b)

res/drawable

c)

res/raw

d)

res/menu

4.

Which statement correctly describes “Layout” in Android?

a)

It’s just a type of TextView

b)

It’s a way to organize Views inside the UI

c)

It can only be created via WYSIWYG

d)

It cannot be nested

5.

In the example, which namespace declaration appears at the top of the layout XML?

6.

In LinearLayout, which attribute defines the orientation of children?

a)

android:orientation

b)

android:gravity

c)

android:layout_weight

d)

android:layout_gravity

7.

In the LinearLayout exercise, which attribute is used to “weight” space among children?

a)

android:layout_weight

b)

android:weightSum

c)

android:layout_margin

d)

android:padding

8.

What is TRUE about FrameLayout per the slide?

a)

Can contain at most one child

b)

Supports multiple layers (Z-order) and first child is at the bottom

c)

Does not support child margins

d)

Does not support gravity

9.

Which statement correctly describes FrameLayout’s Z-order?

a)

Last child is at the bottom

b)

First child is at the bottom

c)

All children are on the same layer

d)

No layer concept

10.

How is RelativeLayout described in the slide?

a)

Positions children absolutely by pixels only

b)

Children are relative to parent and/or to each other

c)

Does not support multiple layers

d)

Has only one child

11.

According to the slide, which of the following is in “Popular Layout Classes”?

a)

ConstraintLayout

b)

RelativeLayout

c)

TableLayout

d)

CoordinatorLayout

12.

Where does ViewPager appear in the slides?

a)

In the “Popular Layout Classes” list

b)

In the FrameLayout example

c)

In the RelativeLayout example

d)

In the Raw data section

13.

Which statement correctly describes the relationship between ViewGroup and View?

a)

A View contains a ViewGroup

b)

A ViewGroup contains Views

c)

Each ViewGroup has only one child View

d)

View and ViewGroup are the same

14.

In the layout example, what is the TextView’s text value?

a)

“Hello World!”

b)

“Is Android a Linux Distribution?”

c)

“Welcome to Android”

d)

“Sample Text”

15.

According to the slide, how can a Layout be created/edited?

a)

Only manually via XML

b)

Only by Java/Kotlin code

c)

By code or WYSIWYG or manual editor

d)

Only by drag-and-drop tools

16.

Which value is used for padding in the layout example?

a)

16sp

b)

16px

c)

16dip

d)

16pt

17.

In the LinearLayout exercise, which resource reference is used to draw a divider?

a)

@raw/divider

b)

@menu/divider

c)

@drawable/divider

d)

@values/divider

18.

According to the slides, which items are listed alongside “Layouts” and “ViewPager” in the topic headers?

a)

Notifications and Services

b)

Values and Drawables

c)

DataBinding and Navigation

d)

Broadcasts and Content Providers

19.

Which statement is TRUE about RelativeLayout per the slides?

a)

Has no multi-layer concept

b)

Only allows constraints to parent, not siblings

c)

Can have Z-order layers like Photoshop

d)

Cannot size children relatively

20.

According to the slide headers, besides Layouts what other topics are mentioned?

a)

Raw data and Menu

b)

Permissions and Gradle

c)

WorkManager and Hilt

d)

CameraX and ML Kit

21.

In a Layout XML file, which attributes are required for every View?

a)

android:layout_width và android:layout_height

b)

android:id và android:layout_width

c)

android:orientation và android:layout_height

d)

android:textAppearance và android:id

22.

What does “Containers (ViewGroups) contain Views” mean?

a)

ViewGroups contain Views such as TextView, ImageView, Button

b)

Views contains ViewGroups

c)

Only RelativeLayout can contain View

d)

Only LinearLayout can contain View

23.

Which of the following is NOT among the listed “Popular Layout Classes”?

a)

FrameLayout

b)

LinearLayout

c)

RelativeLayout

d)

ConstraintLayout

24.

Which statement is correct about the z-order stacking in FrameLayout?

a)

The first child will be at the bottom

b)

The last child will be at the bottom

c)

The children cannot overlap

d)

FrameLayout does not support gravity

25.

In the LinearLayout exercise, how do you make a View take the remaining space?

a)

android:layout_width="match_parent"

b)

android:layout_width="0px" and android:layout_weight="1"

c)

android:layout_height="match_parent"

d)

android:layout_weight="0"

26.

Which folder contains XML drawables?

a)

res/drawable

b)

res/drawable-xxhdpi

c)

res/xml

d)

assets/drawable

27.

Where should bitmap drawables (PNG/JPEG) be placed?

a)

res/drawable-*dpi

b)

res/drawable

c)

res/raw

d)

res/menu

28.

How do you set an image for an ImageView from a drawable?

a)

android:src="@drawable/name"

b)

android:background="@drawable/name"

c)

android:icon="@drawable/name"

d)

android:sourceUri="@drawable/name"

29.

How to set a background image for any View?

a)

android:src="@drawable/name"

b)

android:background="@drawable/name"

c)

android:icon="@drawable/name"

d)

android:drawableTop="@drawable/name"

30.

Which characteristic is correct about 9-patch drawables?

a)

9.png lets you specify stretchable areas and padding

b)

9-patch does not support transparency

c)

9-patch is only for JPEG

d)

9-patch must be placed in res/raw

31.

Which step helps you verify the Vietnamese translation for string values?

a)

Switch the phone language to Vietnamese and check the UI

b)

Rename package to “.vi”

c)

Rebuild project in Release mode

d)

Move strings.xml to res/raw

32.

What orientation does the root LinearLayout use in the example?

a)

vertical

b)

horizontal

c)

grid

d)

no orientation

33.

Which attribute is set for the question TextView in the example?

a)

android:textAppearance="?android:attr/textAppearanceMedium"

b)

android:textStyle="italic"

c)

android:textSize="20sp"

d)

android:fontFamily="serif"

34.

Which spacing attribute appears on the inner LinearLayout in the example?

a)

android:layout_marginTop="16dp"

b)

android:layout_marginBottom="16dp"

c)

android:paddingTop="16dp"

d)

android:layout_marginTop="16sp"

35.

In the LinearLayout exercise, which element is used as a vertical divider?

a)

A View with width="1px", height="match_parent", background="@drawable/divider"

b)

TextView with text="|"

c)

ImageView with src as a line image

d)

Button with transparent background

36.

Which statement is correct about android:id in Layout XML?

a)

It is optional and used for findViewById later

b)

Is a required attribute for every View

c)

Applies to TextView only

d)

Must start with “@android:”

37.

RelativeLayout belongs to which group in the Android UI hierarchy?

a)

View

b)

ViewGroup

c)

Drawable

d)

Resource

38.

Which topics appear together in the “Android Resources” slide navigation?

a)

Layouts, ViewPager, Values, Drawables, Raw data, Menu

b)

Activities, Services, Broadcast, ContentProvider

c)

Networking, Sensors, Maps, Camera

d)

Testing, NDK, JNI, ProGuard

39.

Which capability is supported by FrameLayout?

a)

Supports child margins and gravity

b)

No overlapping support

c)

Only 1 child required

d)

Only padding supported, no margins

40.

Which snippet matches the ImageView in the FrameLayout example?

a)

<ImageView android:id="@+id/imageView" android:layout_width="wrap_content" />

b)

<ImageView android:id="@+id/picture" android:layout_width="match_parent" />

c)

<ImageView android:id="@+id/imageView" android:layout_width="match_parent" />

d)

<ImageView android:id="@+id/img" android:layout_width="wrap_content" android:src="@drawable/x" />