Android MCQ Quiz Hub

Android Programming MCQ Set 3

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

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





✅ Correct Answer: 4

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





✅ Correct Answer: 4

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





✅ Correct Answer: 4

What is the interface Spannable used for?





✅ Correct Answer: 3

What is Android?





✅ Correct Answer: 3

What is the ListActivity class used for?





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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





✅ Correct Answer: 2

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?





✅ Correct Answer: 2

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.





✅ Correct Answer: 4

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





✅ Correct Answer: 4

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





✅ Correct Answer: 4

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





✅ Correct Answer: 2

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





✅ Correct Answer: 3

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





✅ Correct Answer: 2

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





✅ Correct Answer: 2

Which of the following sensors is only hardware-based?





✅ Correct Answer: 4

Which of the following formats is not supported in Android?





✅ Correct Answer: 3

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





✅ Correct Answer: 4

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





✅ Correct Answer: 1

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





✅ Correct Answer: 3

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.





✅ Correct Answer: 2

What is the advantage of using AsyncTaskLoader instead of AsyncTask?





✅ Correct Answer: 4

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





✅ Correct Answer: 1

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.





✅ Correct Answer: 4

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





✅ Correct Answer: 2

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





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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





✅ Correct Answer: 4

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





✅ Correct Answer: 4

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?





✅ Correct Answer: 4

Which of the following statement is correct regarding StrictMode?





✅ Correct Answer: 4

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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?





✅ Correct Answer: 2

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.





✅ Correct Answer: 3

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





✅ Correct Answer: 1

What is correct regarding GCM - Google Cloud Messaging service?





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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)?





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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





✅ Correct Answer: 2

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





✅ Correct Answer: 2

Which of the following are Android build modes?





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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





✅ Correct Answer: 4

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

Which of the following are true about PhoneStateIntentReceiver.notifyPhoneCallState?





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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





✅ Correct Answer: 3

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





✅ Correct Answer: 3

What is "Android-Positron"?





✅ Correct Answer: 2

Which of the following is not Content Provider?





✅ Correct Answer: 3

Which of the following is not Content Provider? ✔





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 2

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





✅ Correct Answer: 1

What is the purpose of the AppCompat library?





✅ Correct Answer: 1

When does ANR occur?





✅ Correct Answer: 3

What is a Master Detail pattern?





✅ Correct Answer: 1

Where should layouts be defined wherever possible?





✅ Correct Answer: 1

What does a strikethrough formatting indicate in Android Studio?





✅ Correct Answer: 4

What is Retrofit?





✅ Correct Answer: 3

What are the Android Support Libraries for?





✅ Correct Answer: 3

What was Project Butter?





✅ Correct Answer: 4

What is a RemoteView for?





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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





✅ Correct Answer: 4

What does ANR stand for?





✅ Correct Answer: 2

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





✅ Correct Answer: 1