Top 30 Android MCQ Questions and Answers with Explanation

Q1. What is Pending Intent in android?
It is a kind of an intent
It is used to pass the data between activities
It will fire at a future point in time.
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?
Android supported all sizes
Android does not support all sizes
Android supports small, normal, large, and extra-large sizes
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?
Only one
Two
AsyncTask doesn't have a tread
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?
Content values are key pair values, which are updated or inserted into the database.
Cursor is used to store the temporary result.
A & B
Cursor is used to store data permanently.
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?
Using the tool, we can redraw images in 9 sections.
image extension tool
image editable tool
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?
Android packages
Android pack
Android packaging kit
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?
Connection management
Cookies management
Authentication management
All of the above
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?
Google Cloud Messaging for chrome
Goggle Count Messaging
Google Message pack
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?
No need to write any commands
Create apk_android in the command line
Javac,dxtool, aapt tool, jarsigner tool, and zipalign
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?
Same as list view
provides the information on respective relative positions
Same as relative layout
None of the above
Answer : B
Explanation : Anchor View provides information on respective relative positions of views.
Q11. What is an activity in Android?
Activity performs the actions on the screen
Manage the Application content
Screen UI
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?
To find the last location of a phone
To find the known location of a phone
To find the last known location of a phone.
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?
A class that can create only an object
Anonymous class
Java class
Base class for all classes
Answer : D
Explanation : Application class is the base class for any android application.
Q14. What is JSON in android?
JavaScript Object Native
Javascript Oriented Notation
Javascript Object Notation
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?
Shared Preferences
Cursor
SQLite database
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?
Permanent data
Secure data
Temporary data
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?
finish()
finishActivity(int requestCode)
A & B
kill()
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?
10 sec
5 sec
1 min
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?
Margin is specifying the extra space left on all four sides in the layout
Padding is used to offset the content of a view by specific px or dp
Both A and B are correct
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?
No, it can't
Yes, Class can be immutable
Can't make the class as final class
None of the above
Answer : B
Explanation : The class can be immutable.
Q21. What is the life cycle of foreground activity in android?
onCreate() −> onStart() −> onResume() −> onStop() −> onRestart
onCreate() −> onStart() −> onResume() −>onStop()
onCreate() −> onStart() −> onResume()
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?
Android deprecated version
There is no value for 1
Android doesn't allow min version 1
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?
4
10
2
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?
It will react to broadcast announcements.
It will do background functionalities as services.
It will pass the data between activities.
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?
integer, boolean
boolean
null
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?
findByID()
findFragmentByID()
getContext.findFragmentByID()
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?
Give the same id for both notifications
Write notification code two times
It is not possible in android
A & B
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?
send intent()
onReceive()
implicitBroadcast()
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?
finish()
getGPSStatus()
onProviderDisable()
getGPS().
Answer : C
Q30. What is the HTTP response error code status in android?
status code < 100
status code > 100
status >= 400
None of the above
Answer : C