-
1.
Which of the following is NOT true about onMeasure() method of class View?
When overriding this method, a developer must call setMeasuredDimension().
It is invoked by measure().
It measures the view and its contents to determine the measured width and height.
It takes three parameters: the height, width, and the depth of the view.
Answer
-
2.
To create a customized Adapter for a compound list item layout, you should:
Extend class android.widget.ListView or any of its descendants, then override method getView()
Extend class android.widget.AbsAdapter or any of its descendants, then override method getView()
Extend class android.widget.Adapter or any of its descendants then override method getView()
Extend class android.widget.Adapter or any of its descendants, then override method getAdapterView()
Answer
-
3.
Which of the following is NOT true about the SharedPreferences interface?
Modifications to preferences saved should go through class SharedPreferences.Editor
It only saves primitive data in key-value pairs.
The data it saves is persistent even if application is killed.
It can save any data type in key-value pairs.
Answer
-
4.
What two methods you have to override when implementing Android option menus?
onCreateOptionsMenu, onOptionsltemSelected
onCreateOptionsMenu, onContextItemSelected
onCreateOptionsMenu, onCreateContextMenu
onCreateContextMenu, onContextItemSelected
Answer
-
5.
What does the following code do?
dialog.getWindow().setFlags(LayoutParams.FLAG_BLUR_BEHIND, LayoutParams.FLAG_BLUR_BEHIND);
Any EditText behind the dialog will be disabled.
When dialog is displayed the activity behind it will be dimmed.
When dialog is displayed the activity behind it will be blurred.
When the dialog is displayed, the edges of the dialog will be blurred.
Answer
-
6.
What Activity method you use to retrieve a reference to an Android view by using the id attribute of a resource XML?
retrieveResourceByld(int id)
findViewByReference(int id)
findViewById(int id)
findViewByld(String id)
Answer
-
7.
Which UI does the following code builds?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmins:android=http://schemas.android.com/apk/res/android android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal">
<TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Name:"/>
<EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:ems="10"/>
</LinearLayout>
<Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Post" />
</LinearLayout>
An edit text to the right of a text view and a button beneath them
An edit text to the right of a text view and a button to the right of the text view
A text view, an edit text beneath it and the button beneath the edit text
An edit text to the left of a text view and a button beneath it
Answer
-
8.
Which of the following is not an Activity lifecycle call-back method?
onStart
onPause
onBackPressed
onCreate
Answer
-
9.
How to enable JavaScript in WebView?
JavaScript is always enabled in WebView
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.SetJavaScriptEnabled(true);
myWebView.getJavaScriptSettings.setFinabled(true);
Answer
-
10.
Which manifest file permission you should add to allow your application to read the device's address book?
READ_PHONE_STATE
READ_ADDRESS_DATA
READ_CONTACTS
READ_PHONE_CONTACTS
Answer
-
11.
Which of the following lines of code starts activity Activity2 from a current activity Activity1?
Intent intent = new intent(this,Activity2.class);
startActivity(intent);
Intent intent = new Intent(new Activity2());
startActivity(intent);
intent intent = new Intent (Activity1.class, Activity2.class);
startActivity(intent);
Intent intent = new intent(this, new Activity2());
startActivity(intent);
Answer
-
12.
During an Activity life-cycle, what is the first callback method invoked by the system?
onStart()
onCreate()
onRestore()
onStop()
Answer
-
13.
Which of the following is the correct way to add access permission to your application?
Add a <uses-permission> tag as a child tag of the <application> tag in AndroidManifest.xml.
Add a <add-permission> tag as a child tag of the <manifest> tag in AndroidManifest.xml.
Add a <uses-permission> tag as a child tag of the <manifest> tag in AndroidManifest.xml.
Add a <permission> tag as a child tag of the <application> tag in AndroidManifest.xml.
Answer
-
14.
Which of the following sets the entire Activity window as a WebView?
setContentView(R.layout.webview);
WebView webview = new WebView(this);
Webview.setAsWindow;
setContentView(“http://www.androidatc.com”);
WebView webview = new WebView(this);
setContentView(webview);
Answer
-
15.
Which of the following is correct about file access in the Android system?
The content of file created by application cannot be accessed by any other application.
Generally, files are handled as dedicated resources per each application
You can only access a file from within an Activity.
Files created by an application can be directly accessed by any application.
Answer
-
16.
What is not true about the AndroidManifest.xml file?
It declares the views used within the application
It declares hardware and software features used within the application
It declares application components
It declares user permissions the application requires
Answer
-
17.
Which of the following is incorrect about intents?
They can be used to start a service
They can be used to start a dialog-themed activity.
They can be used to start an Activity
They can be used to start database insertion
Answer
-
18.
Which of the following statements about DDMS is incorrect?
You can use it to acquire screenshots of a terminal.
You can forcibly execute garbage collection and check the present heap usage status.
You can do simulations of network zone speed and bandwidth limitations.
You can display a list of currently running threads and select one to check its stack trace.
Answer
-
19.
What Eclipse plugin is required to develop Android application?
Android Development Tools
Android Software Development Kit
J2EE
Web Development Tools
Answer
-
20.
Which of these is the correct explanation regarding the following methods?
(1)android.content.Context.sendBroadcast
(2)android.content.Context.startActivity
Both methods are asynchronous.
Both methods throw an exception.
Both methods are defined by overloading.
Both methods are able to broadcast an Intent.
Answer