wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Android

Total questions: 24

Worksheet time: 4mins

Name
Class
Date
1.

To set image in layout we use follow element

a)

ImageView

b)

TextView

c)

LinearLayout

d)

View

2.

To set gap between layout elements we use this attribute

a)

android:layout_margin

b)

android:paddingLeft

c)

android:layout_width

d)

android:layout_height

3.

A layout that arranges its children into rows and columns?

a)

Linear Layout

b)

Table Layout

c)

Frame Layout

d)

Absolute Layout

4.

In relative layout which attributes will be to locate this button

a)

layout_centerHorizontal

b)

layout_centerVertical

c)

layout_centerInParent

d)

layout_above

5.

The basic building element of Android's user interface is called

a)

View

b)

Layout

c)

Activity

d)

ViewGroup

6.

The root element of AndroidManifest.xml is :

a)

View

b)

Manifest

c)

Application

d)

Text

7.

Specify the directory name where the XML layout files are stored

a)

drawable

b)

Activity

c)

/res/layout

d)

/src

8.

In RelativeLayout when specify location of view in center of parent view we use

a)

layout_alignParentLeft

b)

layout_alignParentRight

c)

layout_alignParentTop

d)

layout_centerInParent

9.

Which of the following is a valid sequence of invokes to Activity lifecycle methods?

a)

onCreate > OnStart > onResume > onStop > onDestroy

b)

onCreate > onStart >onResume > onPause > onStop > onResume

c)

onCreate > onStart > onResume

d)

onCreate > onStart > onResume > onPause > onStop > onCreate

10.

Select the method used to access a view element of a layout resource in an activity?

a)

SetImageResource

b)

setText

c)

findViewById

d)

None of these

11.

id attribute is used specify identifier name for a view?

a)

False

b)

True

12.

A Layout where the positions of the children can be described in relation to each other or to the parent?

a)

Frame Layout

b)

Relative Layout

c)

Linear Layout

d)

Table Layout

13.

If user leave the activity which activity lifecycle stage should we release resources used by the MediaPlayer?

a)

onDestroy

b)

onResume

c)

onCreate

d)

onStop

14.

what method to request audio focus from android studio?

a)

onAudioFocusChange

b)

requestAudioFocus

c)

abondonAudioFocus

15.

what value of j in the end of loop?

int j=0;

for ( i= 0; i < 5; i++ )

{

j=j+1 ;

}

a)

6

b)

4

c)

3

d)

5

16.

Which is the correct line of code to get the ID of the EditText you intend to use?

a)

EditText TextHandler =(EditText)findViewById(R.id.nameTextField);

b)

EditText = (EditText)findViewById(R.id.nameTextField);

c)

EditText TextHandler = (EditText)findViewById(nameTextField);

d)

EditText TextHandler = findViewById(R.id.nameTextField);

17.

When we build listview to display elements (1textview and 1 imageview )for each row in listview we need to custom method (getview) in array custom array adapter?

a)

false

b)

True

18.

Which file do you alter the image displayed by the ImageView in?

a)

Drawable

b)

Activity_main_xml

c)

MainActivity

d)

AndroidManifest.XML

19.

Which folder do you copy and paste an image into?

a)

java

b)

Resources

c)

Drawable

d)

Layout

20.

In our android app send email by gmail app we use?

a)

Explicit Intent

b)

Implicit Intent

21.

what is value of x in the end of loop?

int x = 1;

// Exit when x becomes greater than 4

while (x <= 4)

{

//increment the value of x for next iteration

x++;

}

a)

5

b)

4

c)

1

d)

6

22.

Assume you have screen that is 600dp tall, what is the height of “ButtonA” button?

a)

400dp

b)

200dp

c)

500dp

d)

100dp

23.

you decided to log every little thing in a particular part of your app you will use?

a)

log.v(“word1”);

b)

log.i(“activity name”,“word1”);

c)

log.v(“activity name”,“word1”);

d)

log.r(“activity name”,“word1”);

24.

What does sp stand for?

a)

Scale independent Pixel

b)

log.i(“activity name”,“word1”);

c)

log.v(“activity name”,“word1”);

d)

log.r(“activity name”,“word1”);