1. Which of the following are UI elements that you can use in a window in an Android application?
Answers:
  1. TextBox
  2. TextView
  3. TextField
  4. TextElement
  5. EditText
  6. RichText
2. What is the correct way to fix if checking the status of the GPS_PROVIDER throws SecurityException?
Answers:
  1. request permission for ACCESS_COARSE_LOCATION
  2. request permission for ACCESS_FINE_LOCATION
  3. request permission for INSTALL_LOCATION_PROVIDER
  4. None of the above
3. Which of the following is not Content Provider?
Answers:
  1. Contacts
  2. Contacts
  3. Shared Preferences
  4. MediaStore
  5. Bookmarks
  6. Settings
4. Which of the following statements are correct with regards to signing applications?
a) All applications must be signed.
b) No certificate authority is needed.
c) When releasing application special debug key that is created by the Android SDK build tools can be used.
Answers:
  1. a) and b) are true
  2. a) and c) are true
  3. b) and c) are true
  4. all statements are true
5. What does the following code do?
SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE);
List sensors = mgr.getSensorList(Sensor.TYPE_ALL);
for (Sensor sensor : sensors) {
System.out.println(“”+sensor.getName());
}
Answers:
  1. prints names of all available sensors in device
  2. prints names of all available sensor types in device
  3. prints names of all sensors which are not available
  4. none of above
6. What does the following code do?
try {
String token = GoogleAuthUtil.getToken(this, email, “https://www.googleapis.com/auth/devstorage.read_only”);
System.out.println(token);
} catch (IOException e) {
System.out.println(“IOException”);
} catch (UserRecoverableAuthException e) {
System.out.println(“UserRecoverableAuthException”);
} catch (GoogleAuthException e) {
System.out.println(“GoogleAuthException”); 
}
Answers:
  1. prints token
  2. prints IOException
  3. prints UserRecoverableAuthException
  4. prints GoogleAuthException
7. Which of the following is correct to use for data transfer regularly and efficiently, but not instantaneously?
Answers:
  1. AsyncTask
  2. IntentService
  3. Sync adapters
  4. All of these
8. What is the ListActivity class used for?
Answers:
  1. Create a view to display a list of items from a data source.
  2. List all the activities currently running on the Android device.
  3. List all the activites that are installed on the Android device.
  4. List the activities whose IntentFilters match with a particular Intent type.
9. Using a content provider, which of the following operations are able to perform?
a) create 
b) read
c) update
d) delete
Answers:
  1. a, b and c
  2. b, c and d
  3. all of these
  4. none of these
10. Which of the following widgets helps to embed images in activities?
Answers:
  1. ImageView
  2. ImageButton
  3. both of above
  4. none of these
11. What is the best way of opening camera as sub-activity?
Answers:
  1. Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivity(takePictureIntent);
  2. Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, 1); }
  3. Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(takePictureIntent, 1);
  4. Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, -1); }
12. What is the correct way to restrict app visibility on Google Play to devices that have a camera?
Answers:
13. Which of the following sensors is only hardware-based?
Answers:
  1. linear acceleration sensor
  2. gravity sensor
  3. rotation vector sensor
  4. accelerometer sensor
14. Which of the following formats is not supported in Android?
Answers:
  1. MP4
  2. MPEG
  3. AVI
  4. MIDI
15. Which of the following permissions and configurations must be added in manifest file for implementing GCM Client?
A) com.google.android.c2dm.permission.RECEIVE
B) android.permission.INTERNET
C) android.permission.GET_ACCOUNTS
D) android.permission.WAKE_LOCK
E) applicationPackage + “.permission.C2D_MESSAGE”
F) A receiver for com.google.android.c2dm.intent.RECEIVE, with the category set as applicationPackage. The receiver should require the com.google.android.c2dm.SEND permission
Answers:
  1. A, B, C and D
  2. C, D, E and F
  3. A, B, E and F
  4. all of these
16. Which of the following permissons is needed to perform the network operations through internet?
a) INTERNET
b) ACCESS_NETWORK_STATE
Answers:
  1. a
  2. b
  3. both
  4. none
17. Consider the following snippet of code:
@Override
protected void onStop
{
Super.onStop();
SharedPreferences setting = getSharedPreferences(“MyPrefs”, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean(“MyBool”, true);

}
Which of the following should be used ?
Answers:
  1. editor.save(); editor.close();
  2. editor.save(); editor.finish();
  3. editor.commit();
  4. editor.save();
  5. editor.close();
  6. editor.finish();
18. What does the following statement define?
It provides query(), insert(), update(), and delete() methods for accessing data from a content provider and invokes identically-named methods on an instance of a concrete content provider.
Answers:
  1. CursorLoader
  2. ContentResolver
  3. ContentProvider
  4. Loader
19. What is the advantage of using AsyncTaskLoader instead of AsyncTask?
Answers:
  1. a bit easier to work with
  2. the possibility easily update progress bar
  3. no comparison, because it implements completely different functionality
  4. less work with the configuration of applicationM
20. What does the following code do?
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
Answers:
  1. checking Network connection.
  2. checking only WIFI network connectivity.
  3. checking only Bluetooth data connection.
  4. checking only Ethernet data connection
21. Which of the following statements are correct with regards to running of the Sync Adapter?
A) Running sync adapter in response to a user request.
B) Running sync adapter periodically by setting a period of time to wait between runs, or by running it at certain times of the day, or both.
Answers:
  1. Statement A is true, while Statement B is false.
  2. Statement B is true, while Statement A is false.
  3. Both statements are true.
  4. Both statements are false.
22. Which of the following statements are correct with regards to calling place GoogleAuthUtil.getToken()?
A) call getToken() on the UI thread
B) call getToken() on AsyncTask
Answers:
  1. Statement A is true, while Statement B is false.
  2. Statement B is true, while Statement A is false.
  3. Both statements are true.
  4. Both statements are false.
23. Which of the following protocols are provided by Google for GCM Connection Servers?
A) HTTP
B) XMPP
C) SOAP
D) RMI
Answers:
  1. A and B
  2. A, B, C
  3. C, D
  4. all of these
24. Which of the following 4 classes does not relate to others?
ApplicationInfo, SyncInfo, ActivityInfo, PackageInfo
Answers:
  1. ApplicationInfo
  2. SyncInfo
  3. ActivityInfo
  4. PackageInfo
25. Which of the following are valid ways to deploy an Android application to a device?
Answers:
  • Using the “adb install /path/to/apk” command from the command prompt/terminal, when USB Debugging Mode is enabled in the device.
  • Exporting and signing the package, then browsing it to install.
  • Launching the application from an IDE, when USB Debugging Mode is enabled in the device.
  • All of these.
26. Which of the following classes is not used in working with database?
Answers:
  1. SQLiteOpenHelper
  2. SQLiteDatabase
  3. ContentProvider
  4. DatabaseHelper
27. Consider the XML fragment below, which is taken from one of the files in an Android project:

android:layout_width = “fill_parent”
android:layout_height = “fill_parent”
android:text = “Some Text”>

Which of the following are true about the XML fragment above?
Answers:
  1. It is taken from the manifest XML file of the Android project.
  2. It is taken from an XML file used to define a view.
  3. It is taken from the package file (.apk) of the Android project.
  4. The xmlns: attribute is a compulsory attribute.
  5. If this is not the outer most tag in the XML file then it need not contain the xmlns: attribute.
  6. MyElement should be the name of a class derived, directly or indirectly, from the View class.
28. Which of the following statement is correct regarding StrictMode?
Answers:
  1. StrictMode detects improper layouts
  2. StrictMode detects operation which blocks UI
  3. StrictMode detects the speed of the connection
  4. All of the above
29. Consider the code snippet below:
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
mp.start();
Which of the following should be placed at ?
Answers:
  1. mp.prepare();
  2. mp.prepareAsync();
  3. mp.loadMedia();
  4. mp.loadSource();
  5. mp.loadSource(); mp.prepare();
  6. No code is required at to start playback.
30. Consider the code snippet below:
public class MyReceiver extends PhoneStateIntentReceiver
{
@Override
public void onReceiveIntent(Context context, Intent intent)
{
if (intent.action == Intent.CALL_ACTION)
{
}
}
}
Assuming that notifyPhoneCallState has been called to enable MyReceiver to receive notifications about the phone call states, in which of the following cases will the code in get executed?
Answers:
  1. When the device receives an incoming phone call.
  2. When an outgoing phone call is initiated on the device.
  3. When the user presses the CALL button on the device.
  4. The code in will never get executed.
31. Which of the following are true about enabling/disabling menu items from an Activity class?
Answers:
  1. onCreateOptionsMenu can be used to enable/disable some menu items in an Android application.
  2. onPrepareOptionsMenu can be used to enable/disable some menu items in an Android application.
  3. onShowOptionsMenu can be used to enable/disable some menu items in an Android application.
  4. The menu items in an Android application cannot be disabled.
32. Which of the following should be used to save the unsaved data and release resources being used by an Android application?
Answers:
  1. Activity.onStop()
  2. Activity.onPause()
  3. Activity.onDestroy()
  4. Activity.onShutdown()
  5. Activity.onFreeze()
33. Which of the following statements are correct with regards to publishing updates of apps on Google Play?
Answers:
  1. The android:versionCode attribute in the manifest file must be incremented and the APK file must be signed with the same private key.
  2. The android:versionCode attribute in the manifest file must be same and the APK file must be signed with the same private key.
  3. The android:versionCode attribute in the manifest file must be incremented and the APK file must be signed with the new private key.
  4. The android:versionCode attribute in the manifest file must be same and the APK file must be signed with the new private key.
34. Which of the following would you have to include in your project to use the SimpleAdapter class?
Answers:
  1. import android.content;
  2. import android.widget;
  3. import android.database;
  4. import android.database.sqlite;
  5. import android.util;
35. Which of the following is/are appropriate for saving the state of an Android application?
Answers:
  1. Activity.onFreeze()
  2. Activity.onPause()
  3. Activity.onStop()
  4. Activity.onDestroy()
36. Which of the following is the parent class for the main application class in an Android application that has a user interface?
Answers:
  1. MIDLet
  2. AndroidApp
  3. Activity
  4. AppLet
  5. Application
37. Which of the following can be used to bind data from an SQL database to a ListView in an Android application?
Answers:
  1. SimpleCursor
  2. SimpleCursorAdapter
  3. SimpleAdapter
  4. SQLiteCursor
  5. SQLLiteAdapter
38. Consider the code snippet below:
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
mp.start();
Which of the following should be placed at ?
Answers:
  1. mp.prepare();
  2. mp.prepareAsync();
  3. mp.loadMedia();
  4. mp.loadSource();
  5. mp.loadSource(); mp.prepare();
  6. No code is required at to start playback.
39. Which of the following packages provide the classes required to manage the Bluetooth functionality on an Android device?
Answers:
  1. android.hardware
  2. android.bluetooth
  3. android.bluez
  4. org.bluez
40. Which of the following can be accomplished by using the TelephoneNumberUtil class?
Answers:
  1. Save a phone number to the contacts in the phone device.
  2. Retrieve a phone number from the contacts in the phone device.
  3. Delete a phone number from the contacts in the phone device.
  4. Format an international telephone number.
  5. Setting and retrieving the call forwarding phone number on the phone device.
41. Which of the following is the best way to request user permission if an Android application receives location updates from both NETWORK_PROVIDER and GPS_PROVIDER?
Answers:
  1. Adding this line to the Android manifest file:
  2. Adding these two lines to the Android manifest file:
  3. Adding this line to the Android manifest file:
  4. Adding this line to the Android manifest file:
42. Which of the following are true about PhoneStateIntentReceiver.notifyPhoneCallState?
Answers:
  1. notifyPhoneCallState has to be called if your application wishes to receive a notification about an incoming phone call.
  2. notifyPhoneCallState is a call back function that is called when the call state changes.
  3. notifyPhoneCallState is called to initiate a call from the device.
  4. notifyPhoneCallState is used to send notifications about call states.
  5. notifyPhoneCallState gets called when the device receives an incoming phone call.
43. Which of the following statements are correct with regards to Content Providers?
A) A content provider allows applications to access data.
B) A content provider must be declared in the AndroidManifest.xml file.
Answers:
  1. Statement A is true, while Statement B is false.
  2. Statement B is true, while Statement A is false.
  3. Both statements are true.
  4. Both statements are false.
44. Which of the following functions will return all available Content Providers?
Answers:
  1. List returnList = new ArrayList(); for (PackageInfo pack : getPackageManager().getInstalledPackages(PackageManager.GET_PROVIDERS)) { ProviderInfo[] providers = pack.providers; if (providers != null) { returnList.addAll(Arrays.asList(providers)); } } return returnList;
  2. return getContext().getPackageManager().queryContentProviders(“com.google”, Process.myUid(), 0);
  3. List returnList = new ArrayList(); for (PackageInfo pack : getPackageManager().getInstalledPackages(PackageManager.GET_RECEIVERS)) { ActivityInfo[] providers = pack.receivers; if (providers != null) { returnList.addAll(Arrays.asList(providers)); } } return returnList;
  4. None of these.
45. What is the purpose of the ContentProvider class?
Answers:
  1. To play rich media content files.
  2. To create and publish rich media files.
  3. To share data between Android applications.
  4. To access the global information about an application environment.
  5. To maintain global application state.
46. Which of the following are true?
Answers:
  1. Both startActivity and startSubActivity start an activity synchronously.
  2. Both startActivity and startActivityForResults start an activity asynchronously.
  3. startActivity is an asynchronous call, but startSubActivity is synchronous.
  4. startActivity is a synchronous call, but startSubActivity is asynchronous.
47. Which of the following is the immediate base class for Activity and Service classes?
Answers:
  1. Application
  2. ApplicationContext
  3. Context
  4. Component
  5. Object
48. Which of the following are classes that can be used to handle the Bluetooth functionality on a device?
Answers:
  1. Adapte
  2. Manage
  3. Matche
  4. BluetoothAdapte
49. How many expansion files can an APK file have? Select all correct options.
Answers:
  1. one
  2. two
  3. three
  4. four
50. Which of the following are Android build modes?
Answers:
  1. Debug mode
  2. Release mode
  3. Production mode
  4. Development mode
51. What is “Android-dx”?
Answers:
  1. A command line tool to create Android project files.
  2. A framework to create unit tests for Android projects.
  3. A resource editor to create user interface for Android applications.
  4. A tool to generate Android byte code from .class files.
  5. An emulator to execute and debug Android projects.
52. Consider the XML fragment below, which is taken from one of the files in an Android project:
android:layout_width = “fill_parent”
android:layout_height = “fill_parent”
android:text = “Some Text”>