EMT Practice Test

1. Question Content...


Question List

Question1: Which file specifies the minimum required Android SDK version your application supports?

Question2: Which method is used to close an activity?

Question3: Which of the following statements about DDMS is incorrect?

Question4: Which of the following is NOT true about a content provider?

Question5: Which of the following statements hold true about persisting data types using ORMLite third party library?

Question6: Which of the following applies to the onDraw( ) method of class View? (Choose two)

Question7: What does the following code do?
dialog.getWindow().setFlags(LayoutParams.FLAG_BLUR_BEHIND,
LayoutParams.FLAG_BLUR_BEHIND);

Question8: How to enable JavaScript in WebView?

Question9: Which of the following is the base class of all layout UI widgets?

Question10: Consider the following code snippet to query SQLite database:
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?

Question11: Which of the following are constants for Location providers?

Question12: Which attribute would you use to animate the FloatingActionButton, moving it "into" the screen when user clicks it?

Question13: Which Android permission you should add to allow your application to read the device's address book?

Question14: Which of the following is NOT true about onMeasure() method of class View?

Question15: Which of the following WebView methods allows you to manually load custom HTML markup?

Question16: Which of the following are benefits for using fragments in your application? (Choose two)

Question17: Which configuration file holds the permission to use the internet?

Question18: Which of the following measurement units are used in coordinate system when adding locations for testing via Emulator tools? (Choose two.)

Question19: What method you should override to use Android menu system?

Question20: Which of the following would you consider to be a major disadvantage while performing transitions on pre- lollipop release?

Question21: Which of the following options are true for ConstraintLayout?

Question22: android:scheme is added in which of the following tags?

Question23: GPS provider requires a physical device and cannot be tested on an Emulator.

Question24: What code would you need to use for a reverse transition when going from the second activity, back to the first?

Question25: Which one of the following is not a valid name for process state?

Question26: Consider the following AndroidManifest.xml file:
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidatc.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: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?

Question27: You are building an application that supports API level 11 and higher. Which of the following classes you must import if you want to add an Action Bar to your application?

Question28: Which of the following options are correct about ConstraintLayout's baseline constraint handle?

Question29: Which of the following functions does not belong to LocationListener?

Question30: Which of the following is incorrect about ProgressDialog?

Question31: Which of the following is NOT true about SQLiteOpenHelper class? (Choose two)

Question32: Which of the following attributes of the activity tag in the manifest file is used to set an activity screen to landscape orientation?

Question33: Which of the following is a valid sequence of invokes to Activity lifecycle methods? (Select Two)

Question34: 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);

Question35: What does this code do?
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse("http://www.androidatc.com"));
startActivity(intent);

Question36: Which of the following are NOT correct about Normal Permissions? (Choose two)

Question37: Which of these is the correct explanation regarding the following methods?
(1)android.content.Context.sendBroadcast
(2)android.content.Context.startActivity

Question38: Javascript is enabled by default in a WebView

Question39: Which of the following best explains the Android context menus?

Question40: What Eclipse plugin is required to develop Android application?

Question41: Which of the following is NOT true about class DefaultHttpClient?

Question42: Which of the following is true about the Dialog class? (Choose two.)

Question43: Which of the following is not true about using a WebView in your application?

Question44: Consider the following AndroidManifest.xml file.
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidatc "
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="17" />
< application
android:name="MyApp "
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
< activity
android:name="com.androidatc.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
< intent-filter>
< action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
< /activity>
< uses-permission android:name="android.permission.INTERNET" />
< /application>
< /manifest>
Which of the following is correct?

Question45: What is the minimum Android SDK version required for using "Instant Run" feature of Android Studio?

Question46: Consider the following AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mkyong.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.WebActivity " />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".WebViewActivity"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Supposing the application connects to the internet at startup, which of the following is true?

Question47: Which of the following is NOT correct about deep linking?

Question48: Which of the following methods is used to close an activity?

Question49: Which of the following Gradle statements adds the AppCompat library to an Android application?

Question50: Which of the following are layout-related methods called by the framework on views, and you can override them when customizing a view? (Choose two)

Question51: Which of the following permission is necessary for capturing geo-coordinates?

Question52: Which of the following sets the entire Activity window as a WebView?

Question53: What Activity method you use to retrieve a reference to an Android view by using the id attribute of a resource XML?

Question54: Which of the following tools dumps system log messages including stack traces when the device or emulator throws an error?

Question55: During an Activity life-cycle, what is the first callback method invoked by the system?

Question56: Which ORMLite library annotation would you use to mark a class Xyz to be persisted in SQL database?

Question57: Which of the following is NOT the primary hardware involved in performing simple tasks like putting pixels on screen?

Question58: Which UI does the following code builds?
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns: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>

Question59: How many constraint handles are available to us as part of the ConstraintLayout?

Question60: Which of the following is not an Activity lifecycle call-back method?

Question61: Which of the following adds a click listener to items in a ListView?

Question62: Which folder contains the Android project Java files?

Question63: What is the location of APK generated by the build system of Android Studio?

Question64: What package is FloatingActionButton part of?

Question65: CardView extends from which of the following:

Question66: How is the lifecycle of Service connected to the component that started it?

Question67: Which of the following statements is incorrect about Android Device Monitor in Android Studio?

Question68: Which of the following is required for getting the best output from performance profiling tools in Android Studio?

Question69: Best practice to implement Google Maps is to use Webview that calls the online Google Map API.

Question70: Which of following is incorrect about the Toast class?

Question71: Which of these files contains text values that you can use in your application?

Question72: Which of the following is true about attribute android:windowSoftInputMode of the <activity> tag in file AndroidManifest.xml?

Question73: Which of the following does not have a ContenProvider component provided natively by Android SDK?

Question74: What does the src folder contain?

Question75: Which of the following interfaces is necessary to access Google Maps once it is ready?

Question76: Which of the following is not an Android component (i.e. a point from which the system can enter your application)?

Question77: Which of the following is correct about XML layout files?

Question78: To add a new Activity to your application, you need to perform the following steps:

Question79: Which of the following is a valid attribute of ConstraintLayout?

Question80: Which of the following is correct about file access in the Android system?

Question81: Which of the following methods are invoked when a Broadcast Receiver receives a message?

Question82: Which of the following Material Theme attributes are used to custom the color palette in your application?
(Choose Three)

Question83: Which of the following is NOT the built-in layout manager provided by RecyclerView?

Question84: Which version of Android Studio introduced the "Instant Run" feature?

Question85: In which Android version were Runtime permissions added?

Question86: When using an implicit intent, what process does the system use to know what to do with it?

Question87: Which of these is the incorrect method for an Application to save local data?

Question88: If your application is throwing exception android.content.ActivityNotFoundException, which of the following could resolve the problem?

Question89: Which of the following makes a ListView Clickable?

Question90: What does the Android project folder "res/" contain?

Question91: An AsyncTask can be cancelled anytime from any thread.

Question92: Which of the following applies a context menu on a ListView (Choose two)?

Question93: What two methods you have to override when implementing Android option menus?

Question94: Which of the following Activity life-cycle methods is invoked when another activity is shown?

Question95: Which of the following are primary pieces of information that are required to define in an implicit Intent?

Question96: Which of the following Android View sub-classes uses the WebKit rendering engine to display web pages?

Question97: When including a text file in your application to read from as a resource, what is the recommended location of such file?

Question98: The DalvikVM core libraries are a subset of which of the following?

Question99: What are the main two types of threads in Android?

Question100: Which of these is the correct function of Traceview?

Question101: 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?

Question102: Which of the following lines of code starts activity Activity2 from a current activity Activity1?

Question103: Which of the following Classes is responsible for capturing the location using GPS?

Question104: Which of the following is NOT correct about CardView?

Question105: Which of the following is used to group messages in bundled notifications?

Question106: Which of the following is not true about <activity> tag in AndroidManifest file?

Question107: Which of the following is required to allow Android Studio to interact with a custom view?

Question108: Which of the following add a click listener to items in a listView?

Question109: Which of the following statements is true about Google Map API key?

Question110: Which of the following classes is used by Intent to transfer data between different android components?

Question111: Which of the following is NOT correct about the Gradle build system of Android Studio?

Question112: What existing layout is closest to ConstraintLayout in terms of functionality?

Question113: Which of these is the incorrect explanation of the Android SDK and AVD Manager?

Question114: Which is not included in the Android application framework?

Question115: Consider the following code:
@ 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");
}
Which of the following best explains the code above?

Question116: In order to perform a shared element transition, we need to :

Question117: Which of the following is mandatory for a Notification object to contain? (Choose three.)

Question118: Which of the following statements is correct about SQLite?

Question119: What is not true about the AndroidManifest.xml file?

Question120: Which of the following is a call-back method that inflates an options menu from file res/menu/menu.xml?

Question121: Custom views for notifications are allowed in Android.

Question122: Capturing GPS coordinates require creating a project on Google console and enable GPS Capturing.

Question123: How many snackbars can be displayed at a time?

Question124: What is the name of the class used by Intent to store additional information?

Question125: In which Activity life-cycle method you should do all of your normal static set up such as: creating views and bind data to lists?

Question126: When publishing an update to your application to the market, the following must be taken into consideration:

Question127: Which of the following methods can we call in Notification.Builder to add an action?

Question128: When creating a file using android.content.Context.openFileOutput("test.txt", 0), where is the file created?

Question129: Which of the following is a correct Android Manifest statement?

Question130: What Activity method you would use to retrieve a reference to an Android view by using the id attribute of a resource XML?

Question131: Which of the following is incorrect about intents?

Question132: Which of the following is NOT true about method getWindow() of class Dialog?

Question133: Which of the following you cannot achieve by creating your own View sub-classes?

Question134: A developer can create a custom view by extending class Activity.

Question135: Which of the following is not a ContentProvider provided natively by Android?

Question136: Which of the following Activity methods is invoked when the user clicks on an options menu item?

Question137: Which of the following is not included in the Android application framework?

Question138: Which of the following features CANNOT be controlled through CardView's properties?

Question139: Which of the following is incorrect about the LogCat tool?

Question140: Which of the following is correct about Runtime permissions?

Question141: What is direct reply in Android 7?

Question142: Which of the following is NOT a feature provided by the Material Theme?

Question143: What is the name of the folder that contains the R.java file?

Question144: Which one of the following statements is NOT a function of the Action Bar?

Question145: Which of the following is NOT a feature of Android Studio?

Question146: Which of the following tools creates certificates for signing Android applications?

Question147: Which of the following is NOT correct about Battery Historian tool?

Question148: Which of the following tags is not added in <intent-filter> for enabling deep linking in your application?

Question149: On which of the following thread does a Service run?

Question150: Which of the following is not a valid Android resource file name?

Question151: Which of the following is NOT true about the R.java file?

Question152: Which of the following is added as intent action for deep linking?

Question153: AppCompayActivity is the base class for activities that use action bar features of the support library?

Question154: Which of the following is NOT true about class ListActivity?

Question155: Suppose that the <application> tag in the AndroidManifest.XML file of your application has attribute android.theme="@style/AppTheme". Which of the following contents of file /res/value/style.xml correctly applies to the Light Material Theme to your application?

Question156: The values of which of the following classes cannot be mapped in a Bundle object?

Question157: Which of the following is true about implicit intents? (Choose two)

Question158: Which of the following lines of codes adds zoom controls to a WebView?

Question159: Which of the following best explains the Android option menus?

Question160: Which of the following best defines an Android fragment?

Question161: When is the intent resolution process triggered?

Question162: Which of the following Activity life-cycle methods is invoked when a dialog is shown?

Question163: Which of the following information cannot not be included in the Manifest file?

Question164: Which of the following is the base class of all UI components?

Question165: Which of the following Activity life-cycle methods is called once the activity is no longer visible?

Question166: What does the following line of code do?
Toast toast = Toast.makeText(this,"Android ATC", Toast.LENGTH_LONG);
toast.setGravity(Gravity.TOP|Gravity.RIGHT, 0, 0);
toast.show( );

Question167: Which of the following lines of code is used to pass a value to the next activity?

Question168: Which of the following methods invoke a Snackbar?

Question169: Which of these is not defined as a process state?

Question170: To create a blank Wear activity in Android Studio, the project should have a minimum SDK version >= 20.

Question171: What does the following line of code achieve?
Intent intent = new Intent(FirstActivity.this, SecondActivity.class );

Question172: Which of the following permissions is not required to integrate Google Maps into your Android application?

Question173: Which of the following make RecyclerView a better option to use for larger data sets?

Question174: Which of the following is true about method startActivity?

Question175: What work is suitable for Android Services?

Question176: Which of the following statements are correct about the Action Bar? (Choose two.)

Question177: You can create a custom view by extending class:

Question178: Which of the following is NOT true about onMeasure( ) method of class View?

Question179: Which Method allows setting action to snackbars?

Question180: Which of the following WebView methods allows you to manually load HTML from String variable?

Question181: Which of the following methods is called first in an Activity when another activity gets into the foreground?

Question182: Which of the following is correct dependency for adding CardView?

Question183: Which of the following Activity life-cycle methods is invoked first when another activity is shown?

Question184: Which of the following is the correct syntax for adding CardView to a layout file?

Question185: What two methods you have to override when implementing Android context menus?

Question186: What does the following code achieve?
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivityForResult(intent);

Question187: Which of the following is a rule that developers must always follow when writing multi-threaded Android applications? (Choose two)

Question188: When the user clicks on an action item in the action bar, which of the following Activity methods does the system call?

Question189: Which of the following methods updates a ListView when an element is added to the data set?

Question190: Which of the following best explains the Android popup menus?

Question191: Which of the following are NOT types of Runtime permission? (Choose two)

Question192: Which of the following is NOT true about the SharedPreferences interface?

Question193: Which of the following is a Java call-back method invoked when a view is clicked?

Question194: Using Android Studio, you can build applications for Android Wear, Android TV, and Android Auto, as well as Android phones applications.

Question195: Which of the following is NOT true about the MenuItem interface?

Question196: Which package of the following does not have classes needed for Android network connections?

Question197: Which of the following files specifies the minimum required Android SDK version your application supports?

Question198: What is a correct statement about an XML layout file?

Question199: Consider the following code:
Intent i = new Intent(this, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
What best explains the code above?

Question200: What is the default background color of FloatingActionButton?

Question201: Which of the following statements are NOT needed to adding support for RecyclerView with CardView in your application? (Choose two.)

Question202: Which of the following is NOT true about class AsyncTask?

Question203: Which of the following statements is NOT correct about Android fragments?

Question204: Which of these is NOT recommended in the Android Developer's Guide as a method of creating an individual View?

Question205: Which of the following is the correct way to add access permission to your application?

Question206: Which of the following is correct about application file access in the Android system?

Question207: Which of the following is NOT a valid usage for Intents?

Question208: Which of the following are the possible values of app:fabSize attribute of FloatingActionButton?