Question 1
Which of the following is NOT true about class ListActivity?
A. An activity that displays a list of items by binding to a data set.
B. Its layout must be set by calling method setContentView inside onCreate.
C. It contains a ListView object that can be bound to different data sets. Binding, screen layout, and row layout are discussed in the following sections.
D. A data source that can be bound in a ListActivity can be an array or Cursor holding query results.
Answer : B
Question 2
Which of the following is NOT true about method getWindow() of class Dialog do?
A. It retrieves the current window for the activity.
B. It can be used to access parts of the Windows API.
C. It displays the dialog on the screen.
D. It returns null if the activity is not visual.
Answer : C
Question 3
Which of these is the correct explanation regarding the following methods?
(1)android.content.Context.sendBroadcast
(2)android.content.Context.startActivity
A. Both methods are defined by overloading.
B. Both methods throw an exception.
C. Both methods are asynchronous.
D. Both methods are able to broadcast an Intent.
Answer : D
Question 4
Which is the correct explanation of ListView?
A. It is necessary to use ListView as a set with ListActivity.
B. You cannot use a ListView when there is no information to be displayed.
C. When displaying a list of Strings using an ArrayAdapter class in ListView, you must save the value in an ArrayList.
D. ListView has a function to display a list of uniquely defined Views other than TextView.
Answer : D
Question 5
Which of the following a Notification object must contain? (Choose three)
A. A small icon
B. A detail text.
C. A notification sound
D. A title
Answer : A,B,D
Question 6
Consider the following AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mycube.test" android:versionCode="1" android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<activity android:name=".Menu"
android:screenOrientation="portrait"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<activity android:name=".Compute" android:screenOrientation="portrait" />
</manifest>
What is the syntax error of this file?
A. The INTERNET permission must be removed.
B. Tag uses-sdk must have attribute android:maxSdkVersion set.
C. the package name must be “com.mycube.test”.
D. The <activity> tag for Activity “.Compute” should be contained inside <application> tag.
Answer : C
Question 7
Which of the following tools dumps system log messages including stack traces when the device or emulator throws an error?
A. DDMS
B. Logcat
C. Console
D. ADB
Answer : B
Question 8
What two methods you have to override when implementing Android context menus?
A. onCreateOptionsMenu, onCreateContextMenu
B. onCreateContextMenu, onContextItemSelected
C. onCreateOptionsMenu, onOptionsItemSelected
D. onCreateOptionsMenu, onContextItemSelected
Answer : B
Question 9
You can create a custom view by extending class Activity.
A. True
B. False
Answer : B
Question 10
What does the Android project folder “res/” contain?
A. Java Activity classes
B. Resource files
C. Java source code
D. Libraries
Answer : B
Question 11
What method you should override to use Android menu system?
A. onCreateOptionsMenu()
B. onCreateMenu()
C. onMenuCreated()
D. onMenuCreated()
Answer : A
Question 12
Which method is used to close an activity?
A. Destroy()
B. Finish()
C. Stop()
D. Close()
Answer : B
Question 13
Which of the following is the base class of all UI components?
A. ListView
B. Layout
C. View
D. ViewGroup
Answer : C
Question 14
Which of the following is a correct Android Manifest statement?
A. <uses-permission android:name =”android.Internet”/>
B. <uses-permission android:name =”android.Internet”></uses-permission>
C. <uses-permission android:name =”android.permission.Internet”>
D. <uses-permission android:name =”android.permission.Internet”/>
Answer : D
Question 15
Which of the following best explains the Android context menus?
A. It is a popup menu displays a list of items in a vertical list that's anchored to the view that invoked the menu.
B. It is a floating menu that appears when the user performs a long-click on an element. It provides actions that affect the selected content or context frame.
C. It is the primary collection of menu items for an activity. It's where you should place actions that have a global impact on the app, such as "Search," "Compose email," and "Settings".
D. It is a sub-menu of an options menu item.
Answer : B
Question 16
Which of the following is not included in the Android application framework?
A. WindowManager
B. NotificationManager
C. DialerManager
D. PackageManager
Answer : C
Question 17
The values of which of the following classes cannot be mapped in a Bundle object?
A. Parcelable
B. String
C. ArrayList
D. Context
Answer : D
Question 18
Which of the following is correct about XML layout files?
A. In order to display a Ul defined in the XML layout file "main.xml", call the setContentView method of the Activity with the parameter string main.xml".
B. There is no distinction between implementation of the layout definition by code, or by XML layout file.
C. In an Eclipse project using the ADT plug-in, the XML layout file is found in the /res/layout directory.
D. Layout information written in the XML layout file will be converted into code by the Android platform when the screen is displayed.
Answer : C
Question 19
What is the second layer from top called in the following diagram of Androids Architecture
Exhibit:
A. Applications layer.
B. Application framework.
C. Linux kernel.
D. Android runtime.
Answer : B
Question 20
Which of the following is NOT true about onMeasure() method of class View?
A. It measures the view and its contents to determine the measured width and height.
B. It is invoked by measure().
C. The When overriding this method, a developer must call setMeasuredDimension().
D. It takes three parameters: the height, width, and the depth of the view.
Answer : D
Question 21
What Eclipse plug-in is required to develop Android application?
A. J2EE
B. Android Software Development Kit
C. Android Development Tools
D. Web Development Tools
Answer : C
Question 22
Which of the following is incorrect about the LogCat tool?
A. A LogCat view is available as part of the ADT plugin of Eclipse.
B. You can create a log in your application using Log.v(String, String).
C. Each log message has a tag.
D. Only one of your application can create log entries, and it should be component class (Activity, Service,...etc).
Answer : D
Question 23
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);
A. It creates a TextView for each String in array items
B. It creates Buttons for each String in array items
C. It creates four views for listView
D. It replaces the layout of the activity with three consecutive TextView items
Answer : A
Question 24
What Activity method you use to retrieve a reference to an Android view by using the id attribute of a resource XML?
A. findViewByReference(int id)
B. findViewById(int id)
C. retrieveResourceById(int id)
D. findViewById(String id)
Answer : B
Question 25
Which of the following applies a context menu on a ListView? (Choose two)
A. ListView lv = getListView();lv.registerForContextMenu()
B. ListView lv= getListView();registerForContextMenu(lv);
C. ListView lv = (ListView) findViewById(R.id.list_view_id);registerForContextMenu(lv)
D. getListView().setConextMenuEnabled(true)
Answer : B,C
Android Application Development Questions + Answers
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am