Android MCQ Quiz Hub

Android Programming MCQ Set 3

Choose a topic to test your knowledge and improve your Android skills

1. Which of the following can be used to handle commands from menu items in an Android application?




2. Which of the following are true about enabling/disabling menu items from an Activity class?




3. Which of the following function calls can be used to start a Service from your Android application?




4. What is the interface Spannable used for?




5. What is Android?




6. What is the ListActivity class used for?




7. List the activities whose IntentFilters match with a particular Intent type.




8. Which of the following are UI elements that you can use in a window in an Android application?




9. Which of the following is NOT a life-cycle methods of an Activity that can be implemented to perform various operations during the lifetime of an Activity?




10. 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.




11. What does the following code do? SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE); List<Sensor> sensors = mgr.getSensorList(Sensor.TYPE_ALL); for (Sensor sensor : sensors) { System.out.println(""+sensor.getName()); }




12. 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"); }




13. Using a content provider, which of the following operations are able to perform? a) create b) read c) update d) delete




14. Which of the following widgets helps to embed images in activities?




15. What is the best way of opening camera as sub-activity?




16. What is the correct way to restrict app visibility on Google Play to devices that have a camera?




17. Which of the following sensors is only hardware-based?




18. Which of the following formats is not supported in Android?




19. 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




20. Which of the following permissons is needed to perform the network operations through internet? a) INTERNET b) ACCESS_NETWORK_STATE




21. 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); <some more code here> } Which of the following should be used <some more code here>?




22. 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.




23. What is the advantage of using AsyncTaskLoader instead of AsyncTask?




24. 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()); }




25. 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.




26. 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




27. Which of the following protocols are provided by Google for GCM Connection Servers? A) HTTP B) XMPP C) SOAP D) RMI




28. Which of the following 4 classes does not relate to others? ApplicationInfo, SyncInfo, ActivityInfo, PackageInfo




29. Which of the following are valid ways to deploy an Android application to a device?




30. Which of the following classes is not used in working with database?




31. 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?




32. Which of the following statement is correct regarding StrictMode?




33. Which of the following statements are correct with regards to publishing updates of apps on Google Play?




34. Consider the code snippet below: MediaPlayer mp = new MediaPlayer(); mp.setDataSource(PATH_TO_FILE); mp.start(); Which of the following should be placed at ?




35. 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?




36. 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.




37. Which of the following functions will return all available Content Providers?




38. What is correct regarding GCM - Google Cloud Messaging service?




39. Which of the following procedures will get the package name of an APK file?




40. What is the maximum supported file size for a single APK file (excluding expansion packages) in the Google Play Store?




41. Once an app is published, the ________ cannot be changed. It should be unique for each APK.




42. Which of the following attributes in the manifest file defines version information of an application for the Google Play Store (as opposed to defining version information for display to users)?




43. What is the maximum supported size for a single expansion file in the Google Play Store?




44. Which of the following tools can be used to reduce apk package size?




45. Fill in the blank: ___________ makes appropriate list of application data for the other applications.




46. Which of the following are Android build modes?




47. What is the correct way to fix if checking the status of the GPS_PROVIDER throws SecurityException?




48. Which of the following packages provide the classes required to manage the Bluetooth functionality on an Android device?




49. Which of the following is correct to use for data transfer regularly and efficiently, but not instantaneously?




50. Which of the following is/are appropriate for saving the state of an Android application?




51. Which of the following are true about PhoneStateIntentReceiver.notifyPhoneCallState?




52. Which of the following programming languages can be used to develop software applications for the Android platform?




53. Which of the following classes does not relate to other? SQLiteOpenHelper, SQLiteDatabase, Cursor, ContentProvider




54. Which of the following statements is not correct with regards to using Content Providers?




55. What is "Android-Positron"?




56. Which of the following is not Content Provider?




57. Which of the following is not Content Provider? ✔




58. In the context of the Android OS, what is the GC?




59. Which is the correct file in which you should request permissions that an app will use?




60. What feature of the Google Play Store allows developers to release pre-production builds to testers?




61. Which of the following is considered best practice according to Google’s Android Development documentation?




62. The default action resultant when pressing the device back button is to pop the backstack. What is the backstack?




63. What is the purpose of the AppCompat library?




64. When does ANR occur?




65. What is a Master Detail pattern?




66. Where should layouts be defined wherever possible?




67. What does a strikethrough formatting indicate in Android Studio?




68. What is Retrofit?




69. What are the Android Support Libraries for?




70. What was Project Butter?




71. What is a RemoteView for?




72. What must be done after a TypedArray is no longer needed?




73. What is the largest size of a texture that can be loaded within an Android application?




74. What does ANR stand for?




75. When defining a View within an XML layout, which two attributes are always required?