-
1.
Which of these is the incorrect explanation of the Android SDK and AVD Manager?
The "android" command can be used if "<SDK install folder>/tools" is added to the command path.
The development tools that can be downloaded from Android SDK and AVD Manager are SDK Android platform, NDK-platform, emulator images, and USB
drivers for handsets.
You can create and startup AVD, and on startup you can delete user data up to that point.
They are provided from version 1.6 of the SDK. Up to Version 1.5, there was an AVD Manager but it lacked SDK management functions.
Answer
-
2.
Which is not included in the Android application framework?
NotificationManager
DialerManager
PackageManager
WindowManager
Answer
-
3.
Which of these is NOT recommended in the Android Developer's Guide as a method of creating an individual View?
Create by extending already existing View classes such as Button or TextView.
Create by extending the android.view.View class.
Create by combining multiple Views.
Create by copying the source of an already existing View class such as Button or TextView
Answer
-
4.
Which of the following is a call-back method that inflates an options menu from file res/menu/menu.xml?
onCreateOptionsMenu
onCreate
onOptionsItemSelected
onCreateMenu
Answer
-
5.
What does the following code achieve?
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivityForResult(intent);
Starts an activity service
Starts a sub-activity
Starts a browser activity
Sends results to another activity
Answer
-
6.
Which of the following is a correct Android Manifest statement?
<uses-permission android:name="android.Internet"></uses-permission>
<uses-permission android:name="android.permission.Internet”/>
<uses-permission android:name="android.Internet"/>
<uses-permission android:name="android.permission.Internet">
Answer
-
7.
Which of the following WebView methods allows you to manually load custom HTML markup?
loadData
loadCustomData
loadHTML
loadCustomHTML
Answer
-
8.
If your application is throwing exception android.content.ActivityNotFoundException, how to fix it?
Create a new activity Java sub-class.
Add the activity to the AndroidManifest
Rename your activity
Create the activity layout
Answer
-
9.
Which configuration file holds the permission to use the internet?
Java source file
Layout file
Manifest file
Property file
Answer
-
10.
Which of the following is true about object arrayAdapter declared in the code below?
String[] items = {"Item 1","Item 2","Item 3");
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items);
listView.setAdapter(arrayAdapter);
It creates four views for listView.
It creates Buttons for each String in array items.
It replaces the layout of the activity with three consecutive TextView items.
It creates a TextView for each String in array items.
Answer
-
11.
Which of the following lines of code is used to pass a value to the next activity?
Intent i = new intent(this,newActivity);
i.putValue("test");
startActivity(i);
Intent i = new intent(this,newActivity);
i.addExtra("test");
startActivity(i);
Intent i = new intent(this,newActivity);
i.putValue("value1","test");
startActivity(i);
Intent i = new intent(this,newActivity);
i.putExtra("value1","test");
startActivity(i);
Answer
-
12.
Which file specifies the minimum required Android SDK version your application supports?
R.java
AndroidManifest.xml
strings.xml
main.xml
Answer
-
13.
Which of the following information is not included in the Manifest file?
The application's minimum SDK version required.
The handset model compatible with your application.
The permissions required by the application.
The activities contained in the application.
Answer
-
14.
Consider the following code snippet:
String[] result columns = new String[] {KEY ID, COL1, COL2};
Cursor allRows = myDatabase.query(true, DATABASE_TABLE, result_columns, null, null, null, null, null, null);
Which of the following prints out the values of COL1 column correctly if the result is not empty?
if (cursor.moveToFirst()) {
do{
System.out.println(cursor.getString(1));
} while (cursor.moveToNext());
}
if (cursor != null) {
do {
System.out.println(cursor.getString(1));
} while (cursor.isNull());
}
if (cursor != null) {
do {
System.out.println(cursor.getString(1));
} while (cursor.isNull());
}
if (cursor.moveToFirst()) {
do {
System.out.println(cursor.getString(0));
} while (cursor.moveToNext());
}
do {
System.out.println(cursor.getString(0));
} while (cursor.moveToNext());
Answer
-
15.
What does the Android project folder "res/' contain?
Java source code
Resource files
Jawa Activity classes
Libraries
Answer
-
16.
Consider the following code:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse("http://www.androidatc.com"));
startActivity(intent);
Which of the following is correct about the code above?
It will not compile without adding the INTERNET permission the Manifest file.
It starts any activity in the application that has a WebView in its layout.
It sends a result to a new Activity in a Bundle.
When it is executed, the system starts an intent resolution process to start the right Activity.
Answer
-
17.
To add a new Activity to your application, you need to perform the following steps:
Create layout resource only.
Create a Java class that extends View, set a layout, and add an Activity tag in AndroidManifest.xml
Add an Activity tag to AndroidManifest.xml, and add ACTIVITY permission
Create a Java class that extends Activity, add an Activity tag in AndroidManifest.xml, and Create a layout for the activity.
Answer
-
18.
What does the following line of code achieve?
Intent intent = new intent(FirstActivity.this, SecondActivity.class);
Create an explicit intent
Creates an implicit intent
Create a visible intent
Creates a hidden intent
Answer
-
19.
What is the name of the class used by Intent to store additional information?
Bundle
DataStore
Extra
Parcelable
Answer
-
20.
Which of following is a callback method that inflates and options menu from file res/menu/menu.xml?
onCreate
onCreateMenu
onCreateOptionsMenu
onOptionsItemSelected
Answer