Top 30 Android MCQ Questions and Answers with Explanation

By Sahil Bansal | Views: 30024

Q1. What is Pending Intent in android?

  1. It is a kind of an intent

  2. It is used to pass the data between activities

  3. It will fire at a future point in time.

  4. None of the Above

Answer : C

Explanation : Pending Intent is fired or triggered at a future point in time.

 

Q2. How many sizes are supported by Android?

  1. Android supported all sizes

  2. Android does not support all sizes

  3. Android supports small, normal, large, and extra-large sizes

  4. Size is undefined in android

Answer : C

Explanation : 

X-large screens are having at least 960dp*720dp resolutions

Large screens are having at least 640dp*480dp resolutions

Normal screens are having at least 470dp*320dp resolutions

Small screens are having at least 426dp*320dp resolutions

 

Q3. How many threads are there in async Task in android?

  1. Only one

  2. Two

  3. AsyncTask doesn't have a tread

  4. None of the Above

Answer : A

Explanation : In Android 3.0, It is having multi-threads, but now it is having only one thread.

 

Q4.  What is the difference between content values and cursor in android SQLite?

  1. Content values are key pair values, which are updated or inserted into the database.

  2. Cursor is used to store the temporary result.

  3. A & B

  4. Cursor is used to store data permanently.

  5. Content values are used to share the data.

Answer : C

Explanation : Content values are named key pair values which are used to store the data, update the data in the SQLite database. The cursor is a temporary buffering area to store the temporary result of android SQLite.

 

 

Q5. What is the 9 patch tool in android?

  1. Using the tool, we can redraw images in 9 sections.

  2. image extension tool

  3. image editable tool

  4. Device features

Answer : A

Explanation : We can change bitmap images to 9 sections as four corners, four edges, and one axis.

 

Q6. What is an APK in android?

  1. Android packages

  2. Android pack

  3. Android packaging kit

  4. None of the above.

Answer : C

Explanation : APK is an android packaging kit. We can pack/zip, our code in apk format to work on Android devices as an application.

 

Q7. What are the functionalities of the HTTP Client interface in android?

  1. Connection management

  2. Cookies management

  3. Authentication management

  4. All of the above

  5. None of the above

Answer : D

Explanation : HTTP Client has the capabilities to manage connections, cookies, and Authentication.

 

Q8. What is a GCM in android?

  1. Google Cloud Messaging for chrome

  2. Goggle Count Messaging

  3. Google Message pack

  4. None of the above

Answer : A

Explanation : Using google cloud messaging, we can push the data from the servers to client devices. In short, we can send messages to mobile devices through the cloud(Push Notification).

 

Q9. What are commands needed to create APK in android?

  1. No need to write any commands

  2. Create apk_android in the command line

  3. Javac,dxtool, aapt tool, jarsigner tool, and zipalign

  4. None of the above

Answer : C

Explanation :

Using Javac, we can compile Java files

Use dx tool to convert all Java class files to a single dex file

Use AAPT tool to create apk file

Sign the apk file by using jar signer

Zipalign of signed apk

 

Q10. What is anchor view?

  1. Same as list view

  2. provides the information on respective relative positions

  3. Same as relative layout

  4. None of the above

Answer : B

Explanation : Anchor View provides information on respective relative positions of views.

 

Q11. What is an activity in Android?

  1. Activity performs the actions on the screen

  2. Manage the Application content

  3. Screen UI

  4. None of the above

Answer : A

Explanation : Activity is a single screen in an application, Activity performs the actions on the screen(UI)

 

Q12. What is LastKnownLocation in android?

  1. To find the last location of a phone

  2. To find the known location of a phone

  3. To find the last known location of a phone.

  4. None of the above

Answer : C

Explanation : 

To find the last known location of a phone we need to use LastKnownLocation, the syntax is as shown below.

Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);

 

Q13. What is the application class in android?

  1. A class that can create only an object

  2. Anonymous class

  3. Java class

  4. Base class for all classes

Answer : D

Explanation : Application class is the base class for any android application.

 

Q14. What is JSON in android?

  1. JavaScript Object Native

  2. Javascript Oriented Notation

  3. Javascript Object Notation

  4. None of the Above

Answer : C

Explanation : JSON is JavaScript Object Notation with which we can exchange data between two systems in the connected network.

 

Q15. How to store heavily structured data in android?

  1. Shared Preferences

  2. Cursor

  3. SQLite database 

  4. Not possible

Answer : C

Explanation : We can store structured data in SQLite database only. SQLite database is very efficient and faster to read and store the data.

 

Q16. What is transient data in android?

  1. Permanent data

  2. Secure data

  3. Temporary data

  4. Logical data

Answer : D

Explanation : Transient data is logical data and we can store application logic in it.

 

Q17. How to kill an activity in Android?

  1. finish()

  2. finishActivity(int requestCode)

  3. A & B

  4. kill()

  5. None of the Above

Answer : C

Explanation : 

finish() − It is used to close the activity.

finish(int request Code) − It is used to close the activity with the request code.

 

Q18. What is ANR responding time in android?

  1. 10 sec

  2. 5 sec

  3. 1 min

  4. None of the above

Answer : B

Explanation : ANR responding time is 5 sec. If an application is not responding within 5 sec, ANR will occur

 

Q19. What is the difference between margin and padding in the Android layout?

  1. Margin is specifying the extra space left on all four sides in the layout

  2. Padding is used to offset the content of a view by specific px or dp

  3. Both A and B are correct

  4. None of the above

Answer : C

Explanation : Margin specifies the space left on four sides in the layout and padding specifies the exact position where the element going to be taking place in the layout.

 

Q20. Can a class be immutable in android?

  1. No, it can't

  2. Yes, Class can be immutable

  3. Can't make the class as final class

  4. None of the above

Answer : B

Explanation : The class can be immutable.

 

Q21. What is the life cycle of foreground activity in android?

  1. onCreate() −> onStart() −> onResume() −> onStop() −> onRestart

  2. onCreate() −> onStart() −> onResume() −>onStop() 

  3. onCreate() −> onStart() −> onResume()

  4. None of the above

Answer : C

Explanation : Foreground activity should be onCreate() −> onStart() −> onResume() in activity life cycle.

 

Q22. Why don't we give MIN SDK as 1 in android?

  1. Android deprecated version 

  2. There is no value for 1

  3. Android doesn't allow min version 1

  4. None of the above

Answer : A

Explanation : Android version 2.2 is deprecated so we don't need to call the MIN version to be 1.

 

Q23. How many orientations do android support?

  1. 4

  2. 10 

  3. 2

  4. None of the above

Answer : A

Explanation : According to the Google documentation, Android supports 4 types of orientations, those are landscape, portrait, sensor, and No orientation.

 

Q24. What is a broadcast receiver in android?

  1. It will react to broadcast announcements.

  2. It will do background functionalities as services.

  3. It will pass the data between activities.

  4. None of the Above

Answer : A

Explanation : It is a main component of android. It reacts to the system broadcast announcements, and it acts as a gateway between the outside application environment with your application.

 

Q25. What are the JSON elements in android?

  1. integer, boolean

  2. boolean

  3. null

  4. Number, string, boolean, null, array, and object

Answer : D

Explanation : JSON elements are Number, string, boolean, null, array, and object

 

Q26. Fragment in Android can be found through?

  1. findByID()

  2. findFragmentByID()

  3. getContext.findFragmentByID()

  4. FragmentManager.findFragmentByID()

Answer : D

Explanation : Using FragmentManager.findFragmentByID(R.id.fragment), we can find the fragment/fragments which are placed on the layout.

 

Q27. How do you join two notifications in android?

  1. Give the same id for both notifications

  2. Write notification code two times

  3. It is not possible in android

  4. A & B

  5. A & C

Answer : A

Explanation : 

Give the same id for both notifications.

nm.notify(1,notification);

 

Q28. What is the life cycle of broadcast receivers in android?

  1. send intent()

  2. onReceive()

  3. implicitBroadcast()

  4. sendBroadcast(), sendOrderBroadcast(), and sendStickyBroadcast().

Answer : B

Explanation : Broadcast receiver has only onReceive() method. Broadcast starts from onReceive() and control comes out from onReceive().

 

Q29. Which method is used to find GPS enabled or disabled programmatically in android?

  1. finish()

  2. getGPSStatus()

  3. onProviderDisable()

  4. getGPS().

Answer : C

 

Q30. What is the HTTP response error code status in android?

  1. status code < 100

  2. status code > 100

  3. status >= 400

  4. None of the above

Answer : C

Thank you for your feedback!