100 Android MCQ (Multiple Choice Questions) with Answers

 

1) What is the core underlying operating system kernel used by Android?
  1. Windows
  2. Mac OS
  3. Linux
  4. FreeBSD
Show Answer
Answer: c
Explanation
Android is built on top of the Linux kernel, which provides the core system services such as process management, memory management, security, networking and device drivers.


2) Which file format is used to package and install applications on Android devices?

  1. .exe
  2. .apk
  3. .jar
  4. .zip
Show Answer
Answer: b
Explanation
Android apps are packaged and installed as an APK (Android Package Kit) file, which contains the compiled code, resources and manifest.


3) What does OHA stand for in the context of Android?

  1. Open Handset Alliance
  2. Open Handset Association
  3. Open Application Host
  4. Open Hardware Architecture
Show Answer
Answer: a
Explanation
OHA stands for Open Handset Alliance — the consortium of hardware, software and telecom companies announced in 2007 to develop open standards for mobile devices.


4) Which language was officially announced by Google as the preferred language for Android app development?

  1. Java
  2. C++
  3. Kotlin
  4. Python
Show Answer
Answer: c
Explanation
Kotlin was announced as an officially supported language at Google I/O 2017 and became the Kotlin-first preferred language for Android development in 2019.


5) Which file contains metadata, permissions, and registered components of an Android application?

  1. build.gradle
  2. MainActivity.java
  3. AndroidManifest.xml
  4. strings.xml
Show Answer
Answer: c
Explanation
The AndroidManifest.xml file declares the app’s package, permissions, activities, services, receivers, providers and other metadata used by the system.


6) Which virtual machine was used in earlier Android versions before being replaced by ART (Android Runtime)?

  1. JVM
  2. DVM (Dalvik Virtual Machine)
  3. V8
  4. KVM
Show Answer
Answer: b
Explanation
Early Android versions ran apps on the Dalvik Virtual Machine (DVM), which executed .dex bytecode. It was replaced by ART, which compiles ahead of time for better performance.


7) What is the topmost layer of the Android software stack architecture?

  1. Linux Kernel
  2. System Libraries
  3. Application Framework
  4. Applications
Show Answer
Answer: d
Explanation
The Android stack layers (bottom to top) are: Linux Kernel → HAL → System Libraries & Android Runtime → Application Framework → Applications.


8) Which tool converts compiled Java bytecodes (.class files) into Dalvik executable files (.dex)?

  1. AAPT
  2. dx / D8
  3. javac
  4. ProGuard
Show Answer
Answer: b
Explanation
dx (and its modern replacement D8) converts .class bytecode into the .dex format that the Android runtime can execute.


9) What does ANR stand for in Android?

  1. Application Not Responding
  2. Application Not Rendering
  3. Android Network Router
  4. Application Not Reachable
Show Answer
Answer: a
Explanation
ANR means Application Not Responding — a dialog shown when the app’s main thread is blocked for too long.


10) Which open-source license primarily governs the core Android operating system code?

  1. GNU GPL
  2. Apache 2.0
  3. MIT
  4. BSD
Show Answer
Answer: b
Explanation
The Android Open Source Project (AOSP) is released primarily under the Apache License 2.0, though the Linux kernel components remain under GPL.


11) Which fundamental Android component provides a single screen with a user interface?

  1. Service
  2. Activity
  3. Content Provider
  4. Broadcast Receiver
Show Answer
Answer: b
Explanation
An Activity represents a single, focused thing the user can do — typically one screen with a user interface.


12) Which lifecycle method is called first when an Activity is launched?

  1. onStart()
  2. onResume()
  3. onCreate()
  4. onInit()
Show Answer
Answer: c
Explanation
onCreate() is the first lifecycle callback; it is where the activity is initialised and its layout is normally inflated.


13) Which Activity lifecycle method is invoked right before an activity becomes visible to the user?

  1. onCreate()
  2. onStart()
  3. onResume()
  4. onRestart()
Show Answer
Answer: b
Explanation
onStart() is called when the activity is about to become visible to the user, just before it comes to the foreground.


14) When an Activity enters the interactive state with the user, which lifecycle method is triggered?

  1. onStart()
  2. onPause()
  3. onResume()
  4. onCreate()
Show Answer
Answer: c
Explanation
onResume() is called when the activity enters the foreground and becomes interactive — the user can now touch and interact with it.


15) Which method is called when an Activity is completely destroyed and removed from memory?

  1. onStop()
  2. onPause()
  3. onDestroy()
  4. onFinish()
Show Answer
Answer: c
Explanation
onDestroy() is the final lifecycle callback, invoked before the activity instance is destroyed and removed from memory.


16) What happens to an Activity by default when the screen orientation is rotated?

  1. It pauses and resumes instantly without destruction
  2. It is destroyed and recreated
  3. Nothing happens
  4. It triggers an ANR error
Show Answer
Answer: b
Explanation
A configuration change such as rotation destroys and recreates the activity by default, so state must be saved (e.g. with onSaveInstanceState or a ViewModel).


17) Which method is used to attach a layout XML resource to an Activity in onCreate()?

  1. setLayoutView()
  2. setContentView()
  3. attachView()
  4. inflateLayout()
Show Answer
Answer: b
Explanation
setContentView() inflates and attaches a layout resource (or a View) to the activity’s window, usually inside onCreate().


18) Which method is used to programmatically close an Activity?

  1. finish()
  2. stop()
  3. exit()
  4. destroy()
Show Answer
Answer: a
Explanation
finish() tells the system that the activity should be closed and its resources released — the user returns to the previous activity.


19) Which lifecycle method is called when an Activity is stopped and then restarted by the user?

  1. onResume()
  2. onStart()
  3. onRestart()
  4. onCreate()
Show Answer
Answer: c
Explanation
onRestart() is called after onStop() when the activity is coming back to the foreground, and it is followed by onStart().


20) Which object passes state data between Activity destructions during configuration changes?

  1. Intent
  2. Bundle
  3. Context
  4. Resource
Show Answer
Answer: b
Explanation
A Bundle carries key-value state through onSaveInstanceState() and is handed back to onCreate()/onRestoreInstanceState() after the activity is recreated.


21) What component is used to start a new activity or send a message within Android?

  1. View
  2. Intent
  3. Fragment
  4. Provider
Show Answer
Answer: b
Explanation
An Intent is a messaging object used to request an action from another app component — starting an activity, service or delivering a broadcast.


22) Which type of Intent specifies the exact target component class name to launch?

  1. Implicit Intent
  2. Explicit Intent
  3. Broadcast Intent
  4. Pending Intent
Show Answer
Answer: b
Explanation
An Explicit Intent names the exact component (package + class) to start, typically used to launch activities within your own app.


23) Which type of Intent declares a general action to perform without targeting a specific app component directly?

  1. Explicit Intent
  2. Implicit Intent
  3. Direct Intent
  4. Static Intent
Show Answer
Answer: b
Explanation
An Implicit Intent describes an action (e.g. ACTION_VIEW, ACTION_SEND) and lets the system resolve which component can handle it.


24) Which tag in AndroidManifest.xml declares an activity’s ability to respond to implicit intents?

  1. <intent-filter>
  2. <activity>
  3. <service>
  4. <uses-permission>
Show Answer
Answer: a
Explanation
The <intent-filter> element, nested inside <activity>, <service> or <receiver>, declares the actions, categories and data types the component can handle.


25) Which method is used to launch another activity from within an existing activity?

  1. launchActivity()
  2. startActivity()
  3. openActivity()
  4. executeActivity()
Show Answer
Answer: b
Explanation
startActivity(Intent) asks the system to launch the component described by the intent.


26) How do you pass simple primitive data into an Intent?

  1. intent.attachData()
  2. intent.putExtra()
  3. intent.setBundle()
  4. intent.addParam()
Show Answer
Answer: b
Explanation
putExtra(key, value) adds primitive data to the intent’s extras bundle, which the receiving component can read.


27) How do you extract extra data of type String from an Intent inside the destination Activity?

  1. getStringExtra()
  2. getExtraString()
  3. readString()
  4. fetchString()
Show Answer
Answer: a
Explanation
getStringExtra(“key”) returns the String stored in the intent’s extras, or null if it is absent.


28) What wrapper object wraps an Intent to be executed later by another process on your app’s behalf?

  1. DeferredIntent
  2. PendingIntent
  3. RemoteIntent
  4. DelayedIntent
Show Answer
Answer: b
Explanation
A PendingIntent hands an intent to another app (e.g. NotificationManager or AlarmManager) so it can be fired later with your app’s identity and permissions.


29) Which method call gets the result back from a launched Activity when using legacy APIs?

  1. startActivityForResult()
  2. launchForOutput()
  3. startActivityWithReturn()
  4. getActivityResult()
Show Answer
Answer: a
Explanation
startActivityForResult() launched an activity expecting a result via onActivityResult(). It is deprecated in favour of the Activity Result APIs.


30) Which interface optimized for Android performance allows complex data structures to be passed via Intents?

  1. Serializable
  2. Externalizable
  3. Parcelable
  4. DataTransferable
Show Answer
Answer: c
Explanation
Parcelable is Android’s optimised serialization interface, designed to avoid reflection and garbage collection overhead when passing objects between components.


31) What is a Fragment in Android development?

  1. A light background thread
  2. A modular section of an Activity with its own UI and lifecycle
  3. A specialized database table
  4. A network request wrapper
Show Answer
Answer: b
Explanation
A Fragment is a reusable, modular portion of an activity’s UI with its own lifecycle, which can be combined with other fragments in one activity.


32) Can a Fragment exist independently without being hosted by an Activity?

  1. Yes
  2. No
Show Answer
Answer: b
Explanation
No — a fragment must be hosted by an activity (or another fragment host such as a FragmentContainerView); its lifecycle is tied to the host’s.


33) Which Fragment lifecycle method is called to instantiate its user interface layout?

  1. onCreate()
  2. onCreateView()
  3. onActivityCreated()
  4. onViewAttached()
Show Answer
Answer: b
Explanation
onCreateView() is where the fragment inflates and returns its layout hierarchy (or null for a non-UI fragment).


34) Which class is used to perform actions like adding, replacing, or removing Fragments dynamically?

  1. FragmentController
  2. FragmentManager
  3. FragmentTransaction
  4. Both b and c
Show Answer
Answer: d
Explanation
Both are used: the FragmentManager provides access to fragment operations, and a FragmentTransaction (obtained from it) performs the actual add/replace/remove operations.


35) Which method must be called to apply changes made during a FragmentTransaction?

  1. apply()
  2. execute()
  3. commit()
  4. finish()
Show Answer
Answer: c
Explanation
commit() schedules the transaction to be applied (asynchronously on the main thread); commitNow() applies it immediately.


36) Which lifecycle callback signifies that the Fragment’s layout has been detached from its host Activity?

  1. onPause()
  2. onDestroyView()
  3. onDetach()
  4. onStop()
Show Answer
Answer: c
Explanation
onDetach() is the final fragment callback, called after the fragment has been disassociated from its host activity and is no longer attached to it.


37) Which Jetpack component simplifies implementation of navigation between Fragments?

  1. Navigation Component
  2. Router Manager
  3. Fragment Switcher
  4. Screen Flow
Show Answer
Answer: a
Explanation
The Navigation Component provides a navigation graph, a NavHost, and safe args to handle fragment transactions, back stack and deep links declaratively.


38) How can data be shared safely between Fragments belonging to the same host activity using Architecture Components?

  1. Global variables
  2. Shared ViewModel
  3. SharedPreferences
  4. Static singletons
Show Answer
Answer: b
Explanation
A Shared ViewModel scoped to the activity lets fragments observe the same state without tight coupling and survives configuration changes.


39) What method is used to pass arguments safely into a Fragment instance during creation?

  1. setArguments()
  2. putData()
  3. passBundle()
  4. attachParams()
Show Answer
Answer: a
Explanation
setArguments(Bundle) must be called immediately after the fragment is constructed so the arguments are retained across recreation.


40) Which UI component provides sliding tabs to switch between multiple Fragments easily?

  1. TabHost
  2. ViewPager2 with TabLayout
  3. DynamicLayout
  4. FrameLayout
Show Answer
Answer: b
Explanation
A ViewPager2 paired with a TabLayout (via TabLayoutMediator) gives swipeable pages with synchronised tabs.


41) What is the superclass of all UI graphical elements (components) in Android?

  1. Widget
  2. Component
  3. View
  4. Element
Show Answer
Answer: c
Explanation
View is the base class for all UI components — buttons, text fields, layouts and containers all extend it.


42) Which layout manager arranges its child views sequentially either vertically or horizontally?

  1. RelativeLayout
  2. LinearLayout
  3. FrameLayout
  4. ConstraintLayout
Show Answer
Answer: b
Explanation
LinearLayout lays out children one after another in a single direction, controlled by the android:orientation attribute.


43) Which layout allows positioning child elements relative to each other or the parent container?

  1. RelativeLayout
  2. TableLayout
  3. AbsoluteLayout
  4. LinearLayout
Show Answer
Answer: a
Explanation
RelativeLayout positions children using rules such as layout_toRightOf, layout_below or layout_alignParentTop.


44) Which modern, flat-hierarchy layout reduces nested views to optimize UI performance?

  1. ConstraintLayout
  2. RelativeLayout
  3. FrameLayout
  4. GridLayout
Show Answer
Answer: a
Explanation
ConstraintLayout lets you build complex layouts with constraints in a single flat hierarchy, avoiding deep nesting and improving measure/layout performance.


45) What is the unit recommended for specifying text size in Android XML layouts?

  1. px
  2. dp
  3. sp
  4. pt
Show Answer
Answer: c
Explanation
sp (scale-independent pixels) is used for text because it also respects the user’s font-size accessibility setting.


46) What is the unit recommended for defining spacing, dimensions, and margins in Android?

  1. sp
  2. dp (density-independent pixels)
  3. px
  4. in
Show Answer
Answer: b
Explanation
dp keeps physical sizes consistent across screens of different pixel densities; it should be used for layouts, margins and padding.


47) Which UI component is optimized for displaying long, dynamic lists by recycling off-screen views?

  1. ScrollView
  2. ListView
  3. RecyclerView
  4. GridView
Show Answer
Answer: c
Explanation
RecyclerView recycles and rebinds only the visible item views, making it efficient for large or dynamically changing data sets.


48) Which component is responsible for binding data items to the view items in a RecyclerView?

  1. ViewHolders
  2. Adapter
  3. LayoutManager
  4. ItemDecorator
Show Answer
Answer: b
Explanation
The Adapter creates the ViewHolders and binds each data item to its corresponding view; the LayoutManager only positions them.


49) What pattern does RecyclerView force developers to implement to prevent frequent findViewById() calls?

  1. Builder Pattern
  2. ViewHolder Pattern
  3. Observer Pattern
  4. Singleton Pattern
Show Answer
Answer: b
Explanation
The ViewHolder pattern caches view references once per item so findViewById() does not have to be called on every scroll/bind.


50) Which Modern UI toolkit enables building Android UIs natively using declarative Kotlin code?

  1. XML Layouts
  2. Jetpack Compose
  3. Flutter
  4. Android Canvas
Show Answer
Answer: b
Explanation
Jetpack Compose is Android’s modern, fully declarative UI toolkit written in Kotlin, replacing XML-based layouts with composable functions.


51) Which Android component handles operations running in the background without a UI?

  1. Activity
  2. Service
  3. Content Provider
  4. View
Show Answer
Answer: b
Explanation
A Service is a component that performs long-running operations in the background without providing a user interface.


52) What type of Service displays a persistent notification to show it is performing user-aware background work?

  1. Background Service
  2. Foreground Service
  3. Bound Service
  4. Intent Service
Show Answer
Answer: b
Explanation
A Foreground Service must show an ongoing notification, signalling to the user that the app is actively doing visible work.


53) Which class responds to system-wide announcements or events (such as battery low or device boot up)?

  1. BroadcastReceiver
  2. Service
  3. ContentProvider
  4. EventListener
Show Answer
Answer: a
Explanation
A BroadcastReceiver listens for broadcast intents such as ACTION_BOOT_COMPLETED or ACTION_BATTERY_LOW.


54) Which method is triggered inside a BroadcastReceiver when a registered broadcast event occurs?

  1. onReceive()
  2. onBroadcast()
  3. onTrigger()
  4. onEvent()
Show Answer
Answer: a
Explanation
onReceive(Context, Intent) is the only callback of a BroadcastReceiver and runs on the main thread, so it should finish quickly.


55) Which component manages access to a structured repository of data and facilitates sharing it across different applications?

  1. SharedPreference
  2. ContentProvider
  3. BroadcastReceiver
  4. FileProvider
Show Answer
Answer: b
Explanation
A ContentProvider encapsulates a data set and exposes it to other apps through a standard CRUD interface (query, insert, update, delete).


56) What scheme format does a ContentProvider use to identify data items for queries?

  1. HTTP URL
  2. Content URI (content://)
  3. File Path (file://)
  4. JSON Schema
Show Answer
Answer: b
Explanation
Content providers are addressed with a content:// URI, e.g. content://com.example.provider/students/1.


57) Which modern Android Jetpack library is recommended for deferrable, guaranteed background job processing?

  1. AlarmManager
  2. JobScheduler
  3. WorkManager
  4. AsyncTask
Show Answer
Answer: c
Explanation
WorkManager is the recommended API for deferrable background work that must run — it handles constraints, retries, chaining and backwards compatibility.


58) Which method is used to stop a started Service from within the service itself?

  1. stopService()
  2. stopSelf()
  3. finish()
  4. destroy()
Show Answer
Answer: b
Explanation
stopSelf() asks the system to stop this particular service instance; stopService() is called from another component.


59) What happens if a heavy long-running operation is executed on the main UI thread?

  1. App compiles faster
  2. UI freezes and may cause an ANR crash
  3. Memory clears automatically
  4. Android creates a sub-thread automatically
Show Answer
Answer: b
Explanation
Blocking the main thread prevents it from processing input and drawing, freezing the UI and eventually triggering an ANR.


60) Which Kotlin feature is used to write asynchronous non-blocking code cleanly on Android?

  1. Threads
  2. Coroutines
  3. Callbacks
  4. RxJava
Show Answer
Answer: b
Explanation
Coroutines let you write sequential-looking asynchronous code with structured concurrency, suspending instead of blocking threads.


61) Which Android lightweight storage mechanism stores key-value pairs of primitive data types?

  1. SQLite
  2. SharedPreferences
  3. Room
  4. Internal Storage
Show Answer
Answer: b
Explanation
SharedPreferences stores small amounts of primitive key-value data (strings, ints, booleans) in an XML file private to the app.


62) What is the modern replacement for SharedPreferences introduced in Jetpack?

  1. DataStore
  2. FileStore
  3. CacheStore
  4. KeyStore
Show Answer
Answer: a
Explanation
DataStore is the Jetpack replacement for SharedPreferences, offering a coroutine/Flow-based API, type safety and no main-thread blocking.


63) What relational database engine comes embedded by default inside the Android platform?

  1. MySQL
  2. SQLite
  3. PostgreSQL
  4. MongoDB
Show Answer
Answer: b
Explanation
SQLite is a lightweight, serverless, embedded relational database that ships with the Android platform.


64) Which Jetpack persistence library provides an abstraction layer over native SQLite?

  1. LiveData
  2. Room
  3. DataBinding
  4. Realm
Show Answer
Answer: b
Explanation
Room is Jetpack’s ORM-style persistence library that wraps SQLite, validating queries at compile time and reducing boilerplate.


65) What are the three primary components required in the Room persistence library?

  1. Entity, DAO, Database
  2. Table, Query, Controller
  3. Model, Controller, View
  4. Helper, Cursor, Provider
Show Answer
Answer: a
Explanation
Room has three core pieces: @Entity classes (tables), DAO interfaces (data access), and the @Database class that ties them together.


66) What does DAO stand for in Room database terminology?

  1. Data Access Object
  2. Database Android Operations
  3. Direct Access Option
  4. Data Alignment Object
Show Answer
Answer: a
Explanation
DAO stands for Data Access Object — the interface that declares the queries and insert/update/delete operations for a Room database.


67) Which annotation marks a data class as a database table in Room?

  1. @Database
  2. @Entity
  3. @Table
  4. @DataObject
Show Answer
Answer: b
Explanation
@Entity marks a class as a Room table; each property becomes a column and the class represents one row.


68) In Room, SQL queries are defined inside interfaces annotated with which marker?

  1. @Query inside a @DAO interface
  2. @Select inside a Class
  3. @Database inside a Service
  4. @Operation inside a View
Show Answer
Answer: a
Explanation
Queries are written with @Query(“SELECT …”) on methods inside an interface (or abstract class) annotated with @Dao.


69) What object acts as a read-write pointer to result sets returned from SQLite database queries?

  1. Cursor
  2. Dataset
  3. RecordSet
  4. DataPointer
Show Answer
Answer: a
Explanation
A Cursor points at one row of a result set and provides moveToNext(), getString(), getInt() and similar accessors.


70) To save cached files safely that automatically get wiped when memory runs low, which folder directory is used?

  1. External Storage
  2. Cache Directory (cacheDir)
  3. Shared Storage
  4. Asset Folder
Show Answer
Answer: b
Explanation
Files written to cacheDir (getCacheDir()) are private to the app and may be deleted by the system when storage is needed.


71) What build automation system does Android Studio use to compile apps and resolve dependencies?

  1. Maven
  2. Ant
  3. Gradle
  4. Make
Show Answer
Answer: c
Explanation
Android Studio uses Gradle (with the Android Gradle Plugin) to compile, package, and manage dependencies and build variants.


72) Where are non-compiled raw assets like fonts, sound files, or custom JSON files stored in a project?

  1. res/values/
  2. assets/
  3. src/main/
  4. res/raw/ or assets/
Show Answer
Answer: d
Explanation
Unprocessed files can live in res/raw/ (accessed via R.raw.*) or assets/ (accessed via AssetManager), both of which keep the files uncompiled.


73) What automatically generated Java class previously indexed resource IDs in standard Android builds?

  1. R.java
  2. BuildConfig.java
  3. Manifest.java
  4. Resource.java
Show Answer
Answer: a
Explanation
R.java was the generated class containing static integer IDs for every resource (layout, string, drawable, id) in the project.


74) What is the extension of the newer publishing format for Google Play that optimizes APK sizes for devices?

  1. .apk
  2. .aab (Android App Bundle)
  3. .dex
  4. .bundle
Show Answer
Answer: b
Explanation
An .aab (Android App Bundle) is uploaded to Play, which then generates optimised APKs per device configuration.


75) Which feature allows shrinking code, obfuscating names, and removing unused code during release builds?

  1. Gradle Lint
  2. R8 / ProGuard
  3. AAPT2
  4. D8 Compiler
Show Answer
Answer: b
Explanation
R8 (the successor to ProGuard) shrinks, optimises and obfuscates code, removing unused classes and renaming identifiers in release builds.


76) Which build file contains global project configurations, while another contains specific app module dependencies?

  1. settings.gradle
  2. build.gradle (Project) and build.gradle (Module)
  3. manifest.xml
  4. gradle.properties
Show Answer
Answer: b
Explanation
The root (Project) build.gradle holds project-wide configuration and plugin versions, while the module build.gradle declares the app’s dependencies and build types.


77) In Android resources, where should plain human-readable strings be declared for localization support?

  1. strings.xml
  2. dimens.xml
  3. styles.xml
  4. colors.xml
Show Answer
Answer: a
Explanation
Strings belong in strings.xml; placing them in res/values-<locale>/strings.xml lets Android pick the correct translation automatically.


78) Which tool permits creating, managing, and running Android virtual devices on a development machine?

  1. SDK Manager
  2. AVD Manager (Android Virtual Device)
  3. ADB Tool
  4. Logcat
Show Answer
Answer: b
Explanation
The AVD Manager creates and configures emulator instances (device type, system image, hardware profile) that you can run on your machine.


79) What tool command utility lets developers communicate with an attached Android device or emulator over USB?

  1. AAPT
  2. ADB (Android Debug Bridge)
  3. ART
  4. NDK
Show Answer
Answer: b
Explanation
ADB is the command-line bridge used to install APKs, run shell commands, forward ports and read logs from a device or emulator.


80) What is the purpose of Logcat in Android Studio?

  1. Compiling code
  2. Displaying real-time system log messages and application debugging output
  3. Designing XML layouts
  4. Editing database files
Show Answer
Answer: b
Explanation
Logcat shows real-time system and app log messages (verbose through error), which is the primary tool for debugging runtime behaviour.


81) What architectural pattern recommended by Google separates business logic, data state, and UI?

  1. MVC
  2. MVVM (Model-View-ViewModel)
  3. Monolithic
  4. MVP
Show Answer
Answer: b
Explanation
Google’s recommended architecture is MVVM: the View (Activity/Fragment/Compose) observes a ViewModel that exposes UI state derived from the Model/repository layer.


82) What is the main benefit of using a ViewModel over a standard Activity for state management?

  1. It replaces the activity layout
  2. It survives configuration changes (like screen rotation)
  3. It makes network requests automatically
  4. It accesses hardware drivers
Show Answer
Answer: b
Explanation
A ViewModel is retained across configuration changes, so UI state does not have to be reloaded or re-saved when the activity is recreated.


83) What lifecycle-aware observable data holder class is commonly used in MVVM architecture?

  1. LiveData / StateFlow
  2. RxJava
  3. Intent
  4. Broadcast
Show Answer
Answer: a
Explanation
LiveData (and its Kotlin-coroutine counterpart StateFlow) hold observable data and respect the lifecycle of their observers.


84) What happens to a ViewModel instance when its associated Activity is permanently finished?

  1. It persists indefinitely
  2. Its onCleared() method is called and it is disposed
  3. It resets to default constructor values
  4. It transfers to another app
Show Answer
Answer: b
Explanation
When the owning lifecycle is destroyed permanently, the ViewModel’s onCleared() callback runs and the instance is discarded — this is where you cancel jobs or close resources.


85) What official dependency injection library is built on top of Dagger for Android applications?

  1. Koin
  2. Hilt
  3. ButterKnife
  4. Spring
Show Answer
Answer: b
Explanation
Hilt is Google’s opinionated DI library built on Dagger, providing standard Android components and scopes with far less boilerplate.


86) Which Jetpack library safely binds layout views directly to data sources declared in XML layouts?

  1. ViewBinding
  2. DataBinding
  3. Compose
  4. WorkManager
Show Answer
Answer: b
Explanation
DataBinding lets XML layouts reference variables and expressions, automatically updating the UI when the underlying data changes.


87) What is the lighter alternative to DataBinding that generates direct view references without XML expressions?

  1. ViewBinding
  2. Synthetic Binding
  3. Kotlin Extensions
  4. ButterKnife
Show Answer
Answer: a
Explanation
ViewBinding generates a type-safe binding class with direct references to each view — no layout expressions, no annotation processing overhead.


88) In clean architecture, what component contains the core business rules and use cases of an application?

  1. UI Layer
  2. Domain Layer
  3. Data Layer
  4. Framework Layer
Show Answer
Answer: b
Explanation
The Domain layer holds the pure business rules and use cases (interactors), independent of Android frameworks, UI or data sources.


89) What library from Square is widely used in Android to perform HTTP network calls easily?

  1. Volley
  2. Retrofit
  3. OkHttp
  4. Both b and c
Show Answer
Answer: d
Explanation
Both are from Square: OkHttp is the low-level HTTP client and Retrofit is the type-safe REST wrapper built on top of it.


90) Which popular image loading library is natively written in Kotlin and built around Coroutines?

  1. Glide
  2. Picasso
  3. Coil
  4. Fresco
Show Answer
Answer: c
Explanation
Coil (Coroutine Image Loader) is written in Kotlin, uses coroutines for async loading, and integrates cleanly with Compose.


91) From Android 6.0 (API level 23) onwards, how must sensitive permissions (e.g., Camera, Location) be handled?

  1. Declared in Manifest only
  2. Requested dynamically at runtime from the user
  3. Pre-approved automatically on install
  4. Configured via Google Play Console
Show Answer
Answer: b
Explanation
Dangerous permissions must be requested at runtime with requestPermissions() (or the Activity Result API) in addition to being declared in the manifest.


92) Which file controls deep link URL handling and internet permissions for an app?

  1. build.gradle
  2. AndroidManifest.xml
  3. security.xml
  4. network_security_config.xml
Show Answer
Answer: b
Explanation
The AndroidManifest.xml declares <uses-permission android:name=”android.permission.INTERNET”/> and <intent-filter> entries with <data> elements for deep links.


93) What is the permission protection level that requires explicit user confirmation via a prompt dialog?

  1. Normal
  2. Dangerous / Runtime permissions
  3. Signature
  4. System
Show Answer
Answer: b
Explanation
Dangerous permissions (camera, location, contacts, microphone) must be granted by the user through a runtime prompt.


94) What is the maximum time an app can block the main UI thread before an ANR dialog is triggered?

  1. 1 second
  2. ~5 seconds
  3. 30 seconds
  4. 1 minute
Show Answer
Answer: b
Explanation
For input events the ANR threshold is roughly 5 seconds (broadcast receivers have a shorter ~10s for foreground, but for UI/input the classic answer is ~5s).


95) What specialized thread runner in Android handles updates to UI controls?

  1. Main Thread / UI Thread
  2. Worker Thread
  3. IO Thread
  4. Background Thread
Show Answer
Answer: a
Explanation
Only the Main (UI) thread may touch view objects; background threads must post updates back to it via runOnUiThread(), a Handler or a coroutine on Dispatchers.Main.


96) Which tool helps detect memory leaks in Android applications?

  1. LeakCanary
  2. ProGuard
  3. AAPT
  4. Room
Show Answer
Answer: a
Explanation
LeakCanary watches destroyed activities/fragments and dumps a heap trace when they are still reachable, pinpointing the leak.


97) What component sends notification banners to the user outside of the normal app user interface?

  1. NotificationManager
  2. ToastManager
  3. Snackbar
  4. BroadcastManager
Show Answer
Answer: a
Explanation
NotificationManager (obtained via getSystemService) posts notifications that appear in the status bar and shade.


98) Starting from Android 8.0 (API level 26), what must be created before posting any user notification?

  1. Intent Channel
  2. Notification Channel
  3. Broadcast Channel
  4. Priority Listener
Show Answer
Answer: b
Explanation
From API 26, notifications must be assigned to a NotificationChannel, which lets users control importance, sound and vibration per channel.


99) Which simple lightweight UI component shows a quick pop-up message that automatically fades after a short delay?

  1. Dialog
  2. Toast
  3. Snackbar
  4. Banner
Show Answer
Answer: b
Explanation
A Toast shows a short, non-interactive message that disappears on its own and does not block the user.


100) Which system component is responsible for keeping track of open applications and handling memory pressure by killing background processes?

  1. ActivityManager / Low Memory Killer (LMK)
  2. PackageManager
  3. ContentResolver
  4. WindowManager
Show Answer
Answer: a
Explanation
The ActivityManager tracks running apps and process state, and the Low Memory Killer reclaims memory by terminating lower-priority background processes.
100 Power BI MCQ (Multiple Choice Questions) with Answers
100 Machine Learning MCQ (Multiple Choice Questions) with Answers
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment