NEW
Font size
WorksheetsAndroid
Total questions: 24
Worksheet time: 4mins
To set image in layout we use follow element
ImageView
TextView
LinearLayout
View
To set gap between layout elements we use this attribute
android:layout_margin
android:paddingLeft
android:layout_width
android:layout_height
A layout that arranges its children into rows and columns?
Linear Layout
Table Layout
Frame Layout
Absolute Layout
In relative layout which attributes will be to locate this button
layout_centerHorizontal
layout_centerVertical
layout_centerInParent
layout_above
The basic building element of Android's user interface is called
View
Layout
Activity
ViewGroup
The root element of AndroidManifest.xml is :
View
Manifest
Application
Text
Specify the directory name where the XML layout files are stored
drawable
Activity
/res/layout
/src
In RelativeLayout when specify location of view in center of parent view we use
layout_alignParentLeft
layout_alignParentRight
layout_alignParentTop
layout_centerInParent
Which of the following is a valid sequence of invokes to Activity lifecycle methods?
onCreate > OnStart > onResume > onStop > onDestroy
onCreate > onStart >onResume > onPause > onStop > onResume
onCreate > onStart > onResume
onCreate > onStart > onResume > onPause > onStop > onCreate
Select the method used to access a view element of a layout resource in an activity?
SetImageResource
setText
findViewById
None of these
id attribute is used specify identifier name for a view?
False
True
A Layout where the positions of the children can be described in relation to each other or to the parent?
Frame Layout
Relative Layout
Linear Layout
Table Layout
If user leave the activity which activity lifecycle stage should we release resources used by the MediaPlayer?
onDestroy
onResume
onCreate
onStop
what method to request audio focus from android studio?
onAudioFocusChange
requestAudioFocus
abondonAudioFocus
what value of j in the end of loop?
int j=0;
for ( i= 0; i < 5; i++ )
{
j=j+1 ;
}
6
4
3
5
Which is the correct line of code to get the ID of the EditText you intend to use?
EditText TextHandler =(EditText)findViewById(R.id.nameTextField);
EditText = (EditText)findViewById(R.id.nameTextField);
EditText TextHandler = (EditText)findViewById(nameTextField);
EditText TextHandler = findViewById(R.id.nameTextField);
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?
false
True
Which file do you alter the image displayed by the ImageView in?
Drawable
Activity_main_xml
MainActivity
AndroidManifest.XML
Which folder do you copy and paste an image into?
java
Resources
Drawable
Layout
In our android app send email by gmail app we use?
Explicit Intent
Implicit Intent
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++;
}
5
4
1
6
Assume you have screen that is 600dp tall, what is the height of “ButtonA” button?
400dp
200dp
500dp
100dp
you decided to log every little thing in a particular part of your app you will use?
log.v(“word1”);
log.i(“activity name”,“word1”);
log.v(“activity name”,“word1”);
log.r(“activity name”,“word1”);
What does sp stand for?
Scale independent Pixel
log.i(“activity name”,“word1”);
log.v(“activity name”,“word1”);
log.r(“activity name”,“word1”);
