Android Certified
Android Certified
Android Certified
A. onCreateOptionsMenu( )
B. onCreateMenu( )
C. onMenuCreated( )
D. onMenuCreated( )
Answer: A
Q2.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
Q3.Which of the following is not an Android component (i.e. a point from which the system can enter
your application)?
A. Service
B. Activity
C. Layout
D. Content Provider
Answer: C
Q4.During an Activity life-cycle, what is the first callback method invoked by the system?
A. onStop( )
B. onStart( )
C. onCreate( )
D. onRestore( )
Answer: C
Q5.Which configuration file holds the permission to use the internet?
A. Layout file
B. Property file
C. Java source file
D. Manifest file
Answer: D
Answer: C
Answer: D
Q8. Which of the following is not a valid Android resource file name?
A. mylayout.xml
B. myLayout.xml
C.my_layout.xml
D.mylayout1.xml
Answer: B
Q9. Which one of the following is not a valid name for process state?
A. Bound
B. A Visible
C. Foreground
D. Background
Answer: A
Q10. What is a correct statement about an XML layout file?
Answer: B
A. res
B. manifests
C. assets
D. java
Answer: D
Q12.Which file specifies the minimum required Android SDK version your application supports?
A. main.xml
B. R.java
C. strings.xml
D. build.gradle
Answer: D
A. ViewGroup
B. Layout
C. View
D. Widget
Answer: C
Q14. What is the name of the class used by Intent to store additional information?
A. Extra
B. Parcelable
C. Bundle
D. DataStore
Answer: C
Q15.Which of the following is not included in the Android application framework?
A. WindowManager
B. NotificationManager
C. DialerManager
D. PackageManager
Answer: C
Answer: C
A. True
B. False
Answer: B
Q18.Which of these files contains text values that you can use in your application?
A. AndroidManifest.xml
B. res/Text.xml
C.res/layout/Main.xml
D. res/values/strings.xml
Answer: D
Answer: B
Q20. What does this code do?
A. Starts a sub-activity.
B. Starts a service.
C. Sends results to another activity.
D. Starts an activity using an implicit intent.
Answer: D
A. startActivity(Intent intent)
B. startActivityForResult(Intent intent)
C. startService(Intent intent)
D. startSubActivity(Intent intent)
Answer: B
Answer: C
Q23. Which of the following is required for getting the best output from performance profiling tools in
Android Studio?
Answer: D
Q24.What is the second layer from top called in the following diagram of Androids Architecture
A. Applications layer.
B. Application framework.
C. Linux kernel.
D. Android runtime.
Answer: B
Q25.Which of the following tools creates certificates for signing Android applications?
A. adb
B. logcat
C. keytool
D. certgen
Answer: C
Q26. Which Android permission you should add to allow your application to read the devices address
book?
A. READ_ADDRESS_DATA
B. READ_PHONE_STATE
C. READ_PHONE_CONTACTS
D. READ_CONTACTS
Answer: D
Q27.Which of the following methods is called in an Activity when another activity gets into the
foreground?
A. onStop( )
B. onPause( )
C. onDestroy( )
D. onExit( )
Answer: B
Q28.Which of the following attributes is used to set an activity screen to landscape orientation?
A. screenorientation = landscape
B. screenOrientation=landscape
C. android:ScreenOrientation=landscape
D. android:screenOrientation=landscape
Answer: D
Answer: A
Q30. Which of the following commands is used to dump all the battery data in txt file?
Answer: B
Answer: D
Q32.Which of the following statements are NOT needed to adding support for RecyclerView with
CardView in your application? (Choose two)
A. dependencies {
compile 'com.android.support:recyclerview-v7:24.2.1'
}
B. dependencies {
compile 'com.android.support:cardview-v7:24.2.1'
}
C. dependencies {
compile 'com.android.support.recyclerview:design:24.2.1'
}
D. dependencies {
compile 'com.android.support.recyclerview-v7:24.2.1'
}
Answer: C & D
A. <url>
B. <data>
C. <category>
D. <action>
Answer: C
A. layout_constraintEdge_toEdgeOf
B. layout_constraintMiddle_toMiddleOf
C. layout_constraintLeft_toRightOf
D. All answers are correct.
Answer : C
Q35.Consider the following code:
Answer: D
Q36.Which of the following Android View sub-classes uses the WebKit rendering engine to display
web pages?
A. PageView
B. WebView
C. MapView
D. HttpClient
Answer: B
A. webView.getSettings().setBuiltInZoomControls(true);
B. webView.getSettings().setZoomControls(true);
C. webView.getZoomSettings().setControls(CONTROLS.enabled);
D. Zoom controls are included by default in WebViews
Answer: A
A. It is a popup menu that displays a list of items in a vertical list 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 where you should place actions that have a
global impact on the app, such as "Search," "Compose email," and "Settings.
D. It is a type of List Activity with predefined headers and footers for special commands.
Answer: C
Q39.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
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
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Menu");
AdapterContextMenuInfo cmi = (AdapterContextMenuInfo) menuInfo;
menu.add(1, cmi.position, 0, "Open file");
menu.add(2, cmi.position, 0, "Save file");
}
Answer: B
Q42.Which Which of the following does NOT correctly describe interface android.widget.Adapter?
A. It is an object that acts as a bridge between a View and underlying data for that view.
B. It provides access to the data items.
C. It provides access to deprecated ListView methods.
D. It is responsible for making a View for each item in the data set.
Answer: C
Answer: A
Q44.Which of the following applies to the onDraw() method of class View? (Choose two)
Answer: A & C
Q45. GPS provider requires a physical device and cannot be tested on an Emulator.
A. True
B. False
Answer: B
Q46.What is the location of the APK generated by the build system of Android Studio?
A. app/build/apk
B. app/apks
C. app/build/outputs/apk
D. app/intermediates/outputs/apk
Answer: C
Q47.Which of the following statements is NOT correct about Android fragments?
Answer: B
Q48.Which of the following statements is incorrect about Android Device Monitor in Android Studio?
A. You can display a list of currently running threads and select one to check its stack trace.
B. It can add dynamically Google SDK libraries to the Android image running on the emulator.
C. You can forcibly execute garbage collection and check the present heap usage status.
D. You can do simulations of network zone speed and bandwidth limitations.
Answer: B
Answer: C
Answer: B
Q51. Which of the following Classes is responsible for capturing the location using GPS?
A. GPSLocationManager
B. GPSManager
C. LocationManager
D. GPS Provider
Answer: C
Q52.To create a blank Wear activity in Android Studio, the project should have a minimum SDK
version >= 20.
A. True
B. False
Answer: A
Q53.To create a customized Adapter for a compound list item layout , you should:
A. Extend class android.widget.Adapter or any of its descendants then override method getView( )
B. Extend class android.widget.ListView or any of its descendants, then override method getView( )
C. Extend class android.widget.AbsAdapter or any of its descendants, then override method getView( )
D. Extend class android.widget.Adapter or any of its descendants, then override method getAdapterView( )
Answer: A
Q54.When publishing an update to your application to the market, the following must be taken into
consideration:
A. The package name must be the same, but the .apk may be signed with a different private key.
B. The package name does not have to be the same and the .apk can be signed with a different
private key.
C. The package name must be the same and the .apk must be signed with the same private key.
D. The package name does not have to be the same, but the .apk must be signed with the same
private key.
Answer: C
Q55.Which of these is the incorrect method for an Application to save local data?
Answer: D
Q56.Which of the following lines of code is used to pass a value to the next activity?
Answer: D
Q57. Which of the following permissions is not required to integrate Google Maps into your Android
application?
A. android.permission.WRITE_EXTERNAL_STORAGE
B. android.permission.READ_EXTERNAL_STORAGE
C. android.permission.ACCESS_FINE_LOCATION
D. All answers are correct.
Answer: C
Q58.Which of the following lines of code sets the entire Activity window as a WebView?
Answer: C
A. onLocationChanged
B. onStatusChanged
C. onLocationCaptured
D. onProviderDisabled
Answer: C
Q60.Consider the following the code :
Answer: C
Q61.Which of the following is a rule that developers must always follow when writing multi-threaded
Android applications? (Choose two)
Answer: C & D
Q62. Which of the following is the correct syntax for locating a Google Maps Camera?
A. CameraUpdate center =
CameraUpdateFactory.newLatLng(new LatLng(49.894634, -98.22876));
CameraUpdate zoom = CameraUpdateFactory.zoomTo(10);
googleMap.moveCamera(center);
googleMap.animateCamera(zoom);
B. CameraUpdate center =
CameraUpdate (new LatLng(49.894634, -98.22876));
CameraUpdate zoom = CameraUpdateFactory.zoomTo(10);
googleMap.moveCamera(center);
googleMap.animateCamera(zoom);
C. CameraUpdate center =
CameraUpdate (49.894634, -98.22876);
CameraUpdate zoom = CameraUpdateFactory.zoomTo(10);
googleMap.moveCamera(center);
googleMap.animateCamera(zoom);
D. CameraUpdate center =
CameraUpdate (new LatLng(49.894634, -98.22876));
googleMap.moveCamera(center);
Answer: A
Q63.Which of the following is NOT true about class AsyncTask?
Answer: C
Q64.When the user clicks on an action item in the action bar, which of the following Activity methods
does the system call?
A. onOptionsItemSelected()
B. onOptionsItemClicked()
C. onActionButtonSelected()
D. onActionBarItemSelected()
Answer: A
Q65.Gradle is the build system used in Android Studio. It builds, tests, runs, and packages your apps.
A. True
B. False
Answer: A
Q66.Which of the following is NOT correct about the Gradle build system of Android Studio?
Answer: B
Q67.To use the material design features of Android 5.0, you should set the android:targetSdkVersion
attribute to 20 in your applications build.gradle file.
A. True
B. False
Answer: B
Q68.Which UI does the following code builds?
Answer: C
Q69. Assume that a XML layout has 2 views ViewA (with viewA as android:id) and ViewB (with viewB
as android:id). The id of the parent layout is parentId. What would the following code display?
<View
android:id="@+id/viewA"
android:layout_width="50dp"
android:layout_height="50dp"
app:layout_constraintLeft_toRightOf="@+id/viewB"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/viewB"/>
<View
android:id="@+id/viewB"
android:layout_width="50dp"
android:layout_height="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
A. ViewA will be on the top-left corner of the screen and to the right of ViewA will be ViewB, both
aligned next to each other
B. ViewB will be on the top-right corner of the screen. ViewA will be on top of ViewB, such that
bottom edge of ViewA is touching the top edge of ViewB
C. ViewA is in the center of the screen and ViewB is on the left of ViewA such that right edge of
ViewB is touching the left edge of ViewA
D. ViewB is in the center of the screen. ViewA is on the right of ViewB, both aligned on the same
axis
Answer : D
Answer: C
Q71. Which tag can we use to define an action for a broadcast receiver?
A. <receiver android:name:> </receiver>
B. <intent-filter> </intent-filter>
C. <activity></activity>
D. <task></task>
Answer: B
Q72. Which ORMLite library annotation would you use to mark a class Xyz to be persisted in SQL
database?
A. @DatabaseClass
B. @DatabaseTable(tableName = "xyz")
C. @DataTable(tableName = "xyz")
D. @PersistenceTable(name = "xyz")
Answer: B
Q73. Which of the following methods can we call in Notification.Builder to add an action?
A. setContentAction( )
B. setRemoteAction( )
C. setAction( )
D. addAction( )
Answer: D
Answer: A