[go: up one dir, main page]

0% found this document useful (0 votes)
279 views37 pages

Android Development Quiz Questions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
279 views37 pages

Android Development Quiz Questions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. In what year did Google officially announce the Android platform?

A. 2003
B. 2005
C. 2007
D. 2008
✅ Answer: C

2. Android was originally developed by Android Inc. Which of the following people
was not a founder?
A. Andy Rubin
B. Rich Miner
C. Sundar Pichai
D. Nick Sears
✅ Answer: C

3. Android 1.5 introduced the concept of virtual keyboards and video recording. What
was its codename?
A. Cupcake
B. Donut
C. Éclair
D. Alpha
✅ Answer: A

4. Which Android version was the first to support 64-bit architecture natively?
A. Lollipop
B. KitKat
C. Marshmallow
D. Nougat
✅ Answer: A

5. Which Android component is specifically responsible for user interaction and


screen rendering?
A. BroadcastReceiver
B. Activity
C. ContentProvider
D. Service
✅ Answer: B
6. What is the main purpose of [Link]?
A. Define navigation paths
B. Store UI layouts
C. Declare permissions, services, and components
D. Keep app logs
✅ Answer: C

7. Which build tool allows developers to define custom build logic and dependencies?
A. Maven
B. Gradle
C. Ant
D. Dex
✅ Answer: B

8. The Android Runtime (ART) replaced Dalvik in which Android version?


A. KitKat
B. Lollipop
C. Jelly Bean
D. Ice Cream Sandwich
✅ Answer: B

9. Which of the following tools allows a developer to control a device or emulator


instance via command-line?
A. AVD
B. ADB
C. Gradle
D. SDK Manager
✅ Answer: B

10. When is a background Service most appropriately used?


A. To respond to UI clicks
B. To process long-running tasks in the background
C. To interact with fragments
D. To design custom layouts
✅ Answer: B

11. What class must be extended to create a custom BroadcastReceiver?


A. Context
B. Service
C. Receiver
D. BroadcastReceiver
✅ Answer: D

12. Which Android component provides a mechanism for sharing data between apps?
A. Activity
B. Fragment
C. ContentProvider
D. Adapter
✅ Answer: C

13. Kotlin is officially supported for Android development from which Android Studio
version?
A. 2.3
B. 3.0
C. 3.3
D. 4.0
✅ Answer: B

14. What method is called when an Activity becomes visible to the user?
A. onCreate()
B. onStart()
C. onResume()
D. onPause()
✅ Answer: B

15. In Android, which layout is best suited for complex UI hierarchies with
performance in mind?
A. LinearLayout
B. RelativeLayout
C. ConstraintLayout
D. FrameLayout
✅ Answer: C

16. Which lifecycle method should be used to release system resources in a


fragment?
A. onAttach()
B. onCreateView()
C. onDestroyView()
D. onDetach()
✅ Answer: C

17. ANR (Application Not Responding) typically occurs when the main thread is
blocked for more than:
A. 2 seconds
B. 3 seconds
C. 5 seconds
D. 10 seconds
✅ Answer: C

18. Which mechanism is better suited for passing complex objects between Activities
in Android?
A. Serializable
B. Parcelable
C. JSON
D. HashMap
✅ Answer: B

19. Which of the following is not part of Android’s five main components?
A. Services
B. Broadcast Receivers
C. ViewModel
D. Activities
✅ Answer: C

20. What file format is generated after building an Android application?


A. .dex
B. .class
C. .apk
D. .jar
✅ Answer: C

21. Which part of Android architecture manages memory, processes, and power?
A. Application layer
B. Android Runtime
C. Libraries
D. Linux Kernel
✅ Answer: D
22. How does LiveData differ from a regular observable?
A. Lifecycle-aware
B. Thread-blocking
C. UI-exclusive
D. Activity-only
✅ Answer: A

23. The ViewModel class is primarily used for:


A. Rendering layouts
B. Managing UI logic across configuration changes
C. Running animations
D. Displaying fragments
✅ Answer: B

24. What is the primary advantage of RecyclerView over ListView?


A. Simpler layout
B. Automatic pagination
C. Better performance and flexibility
D. Native support for Firebase
✅ Answer: C

25. The Android SDK Manager is used to:


A. Monitor performance
B. Manage system updates
C. Download platform tools, APIs, and emulators
D. Create Gradle files
✅ Answer: C

26. Android fragments must be hosted inside:


A. BroadcastReceiver
B. Service
C. Activity
D. Intent
✅ Answer: C

27. What problem does Android Fragmentation mainly cause?


A. Broken APKs
B. Code corruption
C. Inconsistent user experience across devices
D. Database failure
✅ Answer: C

28. What file should be modified to change minimum supported Android version of an
app?
A. [Link]
B. activity_main.xml
C. [Link] (Module: app)
D. [Link]
✅ Answer: C

29. WorkManager is preferred for which of the following tasks?


A. Real-time notifications
B. UI transitions
C. Guaranteed background work, even after reboot
D. Creating layouts
✅ Answer: C

30. Jetpack is a:
A. UI builder tool
B. Toolkit for backward-compatible Android libraries
C. Debugging utility
D. XML Parser
✅ Answer: B

31. What is the role of Room in Android Architecture Components?


A. UI rendering
B. Network requests
C. Object-relational mapping (ORM) for SQLite
D. Image loading
✅ Answer: C

32. SharedPreferences in Android are best used for:


A. Storing user passwords securely
B. Storing small key-value pairs like settings
C. Managing service threads
D. Transferring files
✅ Answer: B
33. What would be the best option to handle very large datasets for a scrollable list?
A. ScrollView
B. RecyclerView + Paging Library
C. ListView
D. GridLayout
✅ Answer: B

34. The Dagger 2 library in Android is used for:


A. Encryption
B. UI Design
C. Dependency Injection
D. Multithreading
✅ Answer: C

35. Which Gradle plugin is required for Kotlin support in Android?


A. kotlin-core
B. kotlin-android
C. kotlin-runtime
D. kotlin-compiler
✅ Answer: B

36. What is the function of ProGuard in an Android build process?


A. Minify and obfuscate code
B. Improve animations
C. Format XML
D. Analyze network usage
✅ Answer: A

37. What is the purpose of the .dex files in an APK?


A. Store layouts
B. Store compiled resources
C. Contain bytecode for the Android Runtime
D. Save audio/video data
✅ Answer: C

38. What does onSaveInstanceState() handle?


A. Saving data to SharedPreferences
B. Saving UI state across configuration changes
C. Saving to external storage
D. Database backup
✅ Answer: B

39. DataBinding in Android allows:


A. Direct mapping between UI components and data sources
B. Background syncing
C. JSON parsing
D. Layout compression
✅ Answer: A

40. What Android component helps apps react to global system messages?
A. Activity
B. Service
C. BroadcastReceiver
D. ViewModel
✅ Answer: C

41. Coroutines in Kotlin are primarily used for:


A. UI layout
B. Network design
C. Asynchronous programming
D. Encryption
✅ Answer: C

42. Glide or Picasso are used in Android for:


A. Image loading and caching
B. UI styling
C. Battery optimization
D. Accessing content providers
✅ Answer: A

43. How is ViewBinding different from findViewById()?


A. Slower but safer
B. Requires more code
C. Eliminates null pointer exceptions and is type-safe
D. Works only on RecyclerView
✅ Answer: C
44. What is the typical use case of JobScheduler?
A. UI animations
B. Scheduling background tasks under system-defined conditions
C. Sending SMS
D. Audio playback
✅ Answer: B

45. What does Context in Android provide access to?


A. Threads
B. Database only
C. Application resources and environment
D. Virtual machine
✅ Answer: C

46. What is the recommended scope for launching lightweight coroutines tied to the
lifecycle of UI components?
A. GlobalScope
B. IO Scope
C. CoroutineScope
D. lifecycleScope
✅ Answer: D

47. Which Android component best handles long-running downloads in the


background?
A. Service
B. WorkManager
C. IntentService
D. DownloadManager
✅ Answer: D

48. What annotation is used in Room DAO interfaces?


A. @Entity
B. @Insert
C. @ViewModel
D. @Layout
✅ Answer: B

49. What tool helps detect memory leaks in Android apps?


A. Logcat
B. StrictMode
C. LeakCanary
D. Firebase
✅ Answer: C

50. What happens if you don’t call [Link]() in an Activity?


A. App won’t compile
B. App will crash at runtime
C. App will run slowly
D. Nothing
✅ Answer: B

51. Which XML attribute is used to uniquely identify a View in Android layouts?
A. android:id
B. android:tag
C. android:name
D. android:src
✅ Answer: A

52. Which function is used to start another Activity and expect a result?
A. startActivity()
B. startActivityFromIntent()
C. startActivityForResult()
D. openActivity()
✅ Answer: C

53. What permission is required to access the device's internet connection?


A. ACCESS_WIFI_STATE
B. INTERNET
C. ACCESS_NETWORK_STATE
D. NETWORK
✅ Answer: B

54. Which Android API helps manage the back stack in modern app navigation?
A. FragmentManager
B. NavController
C. ViewModel
D. StackManager
✅ Answer: B
55. What Android Studio feature helps analyze performance bottlenecks like memory
leaks?
A. Lint
B. Profiler
C. Emulator
D. Logcat
✅ Answer: B

56. Which Android Jetpack component simplifies navigation between fragments and
activities?
A. Navigation Component
B. LiveData
C. DataBinding
D. Room
✅ Answer: A

57. In Jetpack Compose, which function is used to display UI?


A. setView()
B. Display()
C. Compose()
D. @Composable
✅ Answer: D

58. What is the correct order of Android app architecture layers (bottom to top)?
A. Linux Kernel → Libraries → Android Runtime → Framework → Apps
B. Linux Kernel → Android Runtime → Libraries → Apps → Framework
C. Apps → Framework → Android Runtime → Libraries → Linux Kernel
D. Apps → Libraries → Framework → Kernel → Runtime
✅ Answer: A

59. Which class is used to create an alert dialog box?


A. AlertView
B. NotificationManager
C. [Link]
D. DialogFragment
✅ Answer: C

60. Which type of Intent is used to launch internal components?


A. External Intent
B. Implicit Intent
C. Explicit Intent
D. Static Intent
✅ Answer: C

61. Which lifecycle method is not guaranteed to be called before the app is killed?
A. onPause()
B. onDestroy()
C. onStop()
D. onCreate()
✅ Answer: B

62. Which drawable folder is best for devices with high-density screens?
A. drawable-hdpi
B. drawable-mdpi
C. drawable-xhdpi
D. drawable-ldpi
✅ Answer: C

63. In MVVM architecture, which component handles business logic?


A. View
B. ViewModel
C. Activity
D. Fragment
✅ Answer: B

64. Which permission is required for recording audio?


A. RECORD_AUDIO
B. CAPTURE_AUDIO
C. AUDIO_RECORD
D. ACCESS_AUDIO
✅ Answer: A

65. Looper is most closely associated with:


A. File handling
B. Threading
C. Layout inflation
D. Manifest processing
✅ Answer: B
66. What happens if you run a network request on the main thread?
A. The app crashes
B. The app freezes and may throw NetworkOnMainThreadException
C. The request completes normally
D. The UI improves
✅ Answer: B

67. Which of these is not a valid Android resource type?


A. color
B. value
C. layout
D. drawable
✅ Answer: B

68. Which Gradle file is used to define application ID and minimum SDK?
A. [Link]
B. [Link]
C. [Link] (app module)
D. [Link]
✅ Answer: C

69. The Handler class in Android is used for:


A. Displaying UI
B. Managing permissions
C. Communicating between threads
D. Loading images
✅ Answer: C

70. What is the role of IntentFilter?


A. Define permissions
B. Handle UI logic
C. Specify which Intents an app can respond to
D. Encrypt communication
✅ Answer: C

71. What is an ANR in Android?


A. Android Native Runtime
B. Application Not Responding
C. App Network Recovery
D. Async Notification Receiver
✅ Answer: B

72. In Data Binding, the symbol @{} is used to:


A. Define styles
B. Bind variables to views
C. Add event listeners
D. Load images
✅ Answer: B

73. Which Layout allows child views to be positioned relative to each other?
A. LinearLayout
B. RelativeLayout
C. GridLayout
D. FrameLayout
✅ Answer: B

74. Which is the base class for all layouts in Android?


A. ConstraintLayout
B. ViewGroup
C. FrameLayout
D. RelativeLayout
✅ Answer: B

75. The term "context" in Android refers to:


A. Current UI screen only
B. Global system state
C. Interface to global app environment
D. Layout manager
✅ Answer: C

76. How are resources like colors or strings accessed in code?


A. getResource()
B. R.resource_name
C. getRes()
D. [Link]
✅ Answer: D
77. Which of the following is a lifecycle-aware component?
A. Activity
B. Fragment
C. ViewModel
D. Thread
✅ Answer: C

78. What does the term “fragment transaction” refer to?


A. Database operation
B. Changing fragment layout dynamically
C. Fragment lifecycle event
D. Android update log
✅ Answer: B

79. Which method is used to request permission at runtime?


A. requestPermissions()
B. checkPermission()
C. askPermissions()
D. askForPermission()
✅ Answer: A

80. What is the correct way to declare an Activity in [Link]?


A. <activity name="MainActivity" />
B. <activity android:name=".MainActivity" />
C. <activity id="MainActivity" />
D. <activity file="MainActivity" />
✅ Answer: B

81. What type of file is used to define themes in Android?


A. [Link]
B. [Link]
C. [Link]
D. [Link]
✅ Answer: B

82. Which class is used to implement splash screens in Android 12+?


A. SplashActivity
B. SplashFragment
C. SplashScreen API
D. LaunchTheme
✅ Answer: C

83. Which permission must be declared to access fine-grained location?


A. ACCESS_FINE_LOCATION
B. ACCESS_GPS
C. ACCESS_LOCATION
D. LOCATION_FINE
✅ Answer: A

84. What does the final keyword in Java imply when used in a method?
A. The method cannot be overridden
B. The method is static
C. The method is private
D. The method is only used once
✅ Answer: A

85. How does Android prevent unresponsive UI due to long operations?


A. Jetpack Compose
B. Coroutines or AsyncTask (older)
C. Handlers only
D. Room database
✅ Answer: B

86. Which folder stores layout XML files?


A. res/layout
B. app/layout
C. drawable/layout
D. values/layout
✅ Answer: A

87. Android uses which format to store compiled resources?


A. JAR
B. AAR
C. RSC
D. ARSC
✅ Answer: D
88. How does ActivityResultLauncher improve over startActivityForResult()?
A. Uses deprecated methods
B. Supports only single activity
C. Lifecycle-aware and more type-safe
D. Needs broadcast receivers
✅ Answer: C

89. Which Android Studio tool simulates user actions on an app?


A. Monitor
B. Layout Inspector
C. Espresso
D. Emulator
✅ Answer: D

90. Which of the following tools is best for UI testing?


A. Espresso
B. ADB
C. ProGuard
D. ANR Monitor
✅ Answer: A

91. Which modern image loading library supports Jetpack Compose natively?
A. Picasso
B. Glide
C. Fresco
D. Coil
✅ Answer: D

92. What is the role of Hilt in Android?


A. Network security
B. Background tasks
C. Dependency injection
D. Media playback
✅ Answer: C

93. What is the recommended structure for storing large binary files in Android?
A. SQLite
B. SharedPreferences
C. Internal storage
D. External storage
✅ Answer: D

94. How can an app schedule a task that should repeat periodically?
A. AsyncTask
B. Handler
C. JobScheduler
D. AlarmManager
✅ Answer: D

95. Which component lets developers listen for system-wide broadcasts?


A. Activity
B. Intent
C. Service
D. BroadcastReceiver
✅ Answer: D

96. Which method is triggered when a Fragment’s UI becomes visible?


A. onCreateView()
B. onStart()
C. onResume()
D. onAttach()
✅ Answer: C

97. Jetpack WorkManager guarantees:


A. UI updates
B. Background execution under constraints
C. Broadcast delivery
D. Message passing
✅ Answer: B

98. How can you prevent screen rotation in [Link]?


A. android:screenOrientation="static"
B. android:screen="locked"
C. android:screenOrientation="portrait"
D. android:orientation="block"
✅ Answer: C
99. What component controls layout drawing and event handling in Android?
A. Window
B. LayoutInflater
C. View
D. Drawable
✅ Answer: C

100. Which layer of Android architecture includes SQLite, SSL, and media
frameworks?
A. Application Framework
B. Native Libraries
C. Linux Kernel
D. Android Runtime
✅ Answer: B

101. Which method is used in Room DAO interface to insert a single row?
A. add()
B. insertRow()
C. @Insert
D. save()
✅ Answer: C

102. Which Android component is responsible for managing app permissions at


runtime?
A. PackageManager
B. PermissionManager
C. AppOpsManager
D. ContextCompat
✅ Answer: D

103. What annotation is used in Room to define the primary key of an entity?
A. @Id
B. @Key
C. @PrimaryKey
D. @EntityKey
✅ Answer: C

104. In Jetpack, what does LiveData do?


A. Stores persistent data
B. Allows observing data changes
C. Handles background tasks
D. Loads images
✅ Answer: B

105. Which folder is used to define different themes for Android apps?
A. res/themes
B. res/values/themes
C. res/values
D. res/values/[Link]
✅ Answer: D

106. What will happen if an exception occurs on the main thread?


A. App will automatically restart
B. App will crash
C. App will ignore the exception
D. Nothing happens
✅ Answer: B

107. Which method is triggered when an Activity comes to the foreground?


A. onStart()
B. onResume()
C. onCreate()
D. onRestart()
✅ Answer: B

108. Which of the following is NOT an Android component?


A. BroadcastReceiver
B. Service
C. Intent
D. ContentProvider
✅ Answer: C

109. What is the primary use of PendingIntent in Android?


A. Display UI
B. Delay a method
C. Trigger future tasks like notifications
D. Cancel services
✅ Answer: C
110. The Navigation Graph XML is used for:
A. Layout design
B. Managing manifest settings
C. Declaring navigation paths
D. Styling UI
✅ Answer: C

111. Which Android class is used to handle camera-related operations?


A. MediaManager
B. CameraX
C. PhotoCapture
D. VideoUtils
✅ Answer: B

112. Room Database requires which annotation on the class that holds the database?
A. @Database
B. @RoomDB
C. @DataSource
D. @EntityManager
✅ Answer: A

113. Which method is used to stop a running Service?


A. finish()
B. stop()
C. stopService()
D. endService()
✅ Answer: C

114. What is the use of ANR logs in Android?


A. UI testing
B. Background threading
C. Debugging app freezing issues
D. Storage permission
✅ Answer: C

115. Which architecture component allows storing data that survives configuration
changes?
A. Repository
B. ViewModel
C. Room
D. ContentProvider
✅ Answer: B

116. In Kotlin, what symbol is used for safe call operator?


A. !
B. ?:
C. ?.
D. ==
✅ Answer: C

117. Which component is preferred for heavy background tasks that must complete
even after app is closed?
A. AsyncTask
B. JobIntentService
C. WorkManager
D. Thread
✅ Answer: C

118. The android:exported attribute in AndroidManifest is used to:


A. Prevent data loss
B. Specify if component can be launched by other apps
C. Improve performance
D. Make app visible in launcher
✅ Answer: B

119. To access a web API in Android securely, developers should use:


A. Room
B. Retrofit or Volley
C. ADB
D. BroadcastReceiver
✅ Answer: B

120. Which keyword in Kotlin defines a class that cannot be inherited?


A. sealed
B. abstract
C. final
D. static
✅ Answer: C
121. Which tool is used for generating app signing keys in Android?
A. Android Profiler
B. Emulator
C. keytool
D. Gradle
✅ Answer: C

122. What is the purpose of [Link] file?


A. Build configurations
B. Code shrinking and obfuscation
C. Unit testing
D. Library linking
✅ Answer: B

123. Which lifecycle method is guaranteed to be called before an activity is


destroyed?
A. onResume()
B. onPause()
C. onDestroy()
D. onStop()
✅ Answer: C

124. What is the main use of [Link]?


A. Animate transitions
B. Handle click events
C. Bind data to list-based UI
D. Manage fragments
✅ Answer: C

125. Which component handles system-wide broadcast messages?


A. Service
B. IntentFilter
C. BroadcastReceiver
D. Activity
✅ Answer: C

126. Which lifecycle method is called when fragment’s UI is no longer visible?


A. onPause()
B. onStop()
C. onDestroyView()
D. onDetach()
✅ Answer: B

127. What is the use of @Entity annotation in Room?


A. Declares model class
B. Converts class into table
C. Creates new fragment
D. Stores preferences
✅ Answer: B

128. What is the correct sequence of Android activity lifecycle methods?


A. onCreate → onPause → onResume → onDestroy
B. onCreate → onStart → onResume → onPause → onStop → onDestroy
C. onStart → onResume → onCreate → onPause → onDestroy
D. onPause → onStop → onResume → onDestroy
✅ Answer: B

129. What is [Link] in Android?


A. Runtime class
B. Resource indexing class
C. Recycler class
D. Root class
✅ Answer: B

130. Which layout is best for placing components dynamically in X, Y positions?


A. LinearLayout
B. RelativeLayout
C. ConstraintLayout
D. FrameLayout
✅ Answer: C

131. What is the main advantage of using ViewBinding over findViewById()?


A. Less memory usage
B. Automatic UI generation
C. Compile-time safety
D. Faster UI rendering
✅ Answer: C
132. Which of the following Android Jetpack libraries is used for managing
background jobs?
A. Navigation
B. LiveData
C. ViewModel
D. WorkManager
✅ Answer: D

133. What is an Intent in Android?


A. XML element
B. Communication message between components
C. Layout manager
D. Storage class
✅ Answer: B

134. How do you define a Fragment in XML layout?


A. <[Link] />
B. <fragment android:name="..." />
C. <[Link] />
D. <[Link] />
✅ Answer: B

135. In MVVM, which layer communicates with the database or API?


A. View
B. Model
C. ViewModel
D. Activity
✅ Answer: B

136. What annotation defines a Room table with a non-null field?


A. @Nullable
B. @PrimaryKey
C. @ColumnInfo(nullable = false)
D. @NonNull
✅ Answer: D

137. What is the main benefit of using DataStore over SharedPreferences?


A. Simpler syntax
B. Faster UI
C. Type safety and asynchronous support
D. Room integration
✅ Answer: C

138. In Android, broadcast receivers must be declared in:


A. MainActivity
B. [Link]
C. [Link] or registered dynamically
D. [Link]
✅ Answer: C

139. What is the role of Android’s ART (Android Runtime)?


A. UI management
B. Storage
C. Application execution
D. Broadcast delivery
✅ Answer: C

140. Which Gradle dependency adds Room runtime support?


A. room-compiler
B. room-runtime
C. room-core
D. room-data
✅ Answer: B

141. A sealed class in Kotlin is useful for:


A. Declaring themes
B. Managing UI layouts
C. Representing restricted class hierarchies
D. Implementing gestures
✅ Answer: C

142. Android fragments must always be hosted by a:


A. View
B. Activity
C. BroadcastReceiver
D. Service
✅ Answer: B
143. Which architecture pattern is promoted in Android Jetpack?
A. MVC
B. MVVM
C. MVP
D. VIPER
✅ Answer: B

144. What is an ActivityResultContract?


A. New way of handling runtime permissions
B. Simplified way of getting results from activities
C. Tool for layout styling
D. Unit testing class
✅ Answer: B

145. How do you persist complex objects using SharedPreferences?


A. Convert to byte stream
B. Use SQLite
C. Use JSON serialization
D. Use file write
✅ Answer: C

146. How is compileSdkVersion related to app compatibility?


A. It defines the minimum OS version
B. It tells Gradle to compile against this API level
C. It restricts users from installing
D. It is used only for themes
✅ Answer: B

147. Which annotation is used for Room DAO update method?


A. @Modify
B. @Update
C. @Change
D. @Write
✅ Answer: B

148. Which storage is accessible only by the app itself?


A. Shared External Storage
B. Internal Storage
C. SD Card
D. MediaStore
✅ Answer: B

149. What does adb stand for in Android development?


A. Android Database
B. Android Debug Bridge
C. Android Developer Build
D. Application Data Binder
✅ Answer: B

150. The @Ignore annotation in Room is used to:


A. Skip an entity from DB
B. Skip a field from persistence
C. Disable LiveData
D. Disable DAO
✅ Answer: B

151. Which Android component is used to receive phone calls or SMS messages?
A) BroadcastReceiver
B) Service
C) Activity
D) ContentProvider
Answer: A

152. To share data between different parts of an app, which ViewModel is used?
A) SharedViewModel
B) LocalViewModel
C) AppViewModel
D) FragmentViewModel
Answer: A

153. Which permission is needed to access the device’s location?


A) ACCESS_FINE_LOCATION
B) INTERNET
C) CAMERA
D) READ_SMS
Answer: A
154. Which component is used to run periodic background tasks?
A) AsyncTask
B) Handler
C) WorkManager
D) [Link]()
Answer: C

155. Which layout manager shows items in a grid in RecyclerView?


A) LinearLayoutManager
B) GridLayoutManager
C) StaggeredGridLayoutManager
D) RelativeLayoutManager
Answer: B

156. What does the onBind() method do in a Service?


A) Starts the service
B) Returns communication channel to clients
C) Stops the service
D) Creates UI
Answer: B

157. Which of these is NOT a valid permission level in Android?


A) normal
B) dangerous
C) system
D) privileged
Answer: C

158. How do you start a new thread in Android?


A) new Thread().start()
B) run()
C) createThread()
D) startThread()
Answer: A

159. What is the purpose of the Looper class?


A) To manage UI changes
B) To manage the message queue of a thread
C) To animate views
D) To load resources
Answer: B

160. Which file contains the Gradle build settings for an app module?
A) [Link]
B) [Link] (module)
C) [Link]
D) [Link]
Answer: B

161. How do you declare a Service in [Link]?


A) <service android:name=".MyService" />
B) <activity android:name=".MyService" />
C) <receiver android:name=".MyService" />
D) <provider android:name=".MyService" />
Answer: A

162. Which tool helps analyze the size and content of an APK?
A) Android Studio Profiler
B) APK Analyzer
C) ADB shell
D) Logcat
Answer: B

163. Which class is used to access an SQLite database in Android?


A) SQLiteDatabase
B) SQLiteHelper
C) DatabaseManager
D) DBConnector
Answer: A

164. Which of the following is NOT part of Android Jetpack?


A) Room
B) Data Binding
C) Retrofit
D) Navigation
Answer: C

165. What is a Dex file in Android?


A) Compiled Java source code
B) Dalvik Executable file
C) Layout XML file
D) Debug executable file
Answer: B

166. Which classes help load large images efficiently?


A) BitmapFactory
B) Glide
C) Picasso
D) All of these
Answer: D

167. What does ProGuard do?


A) Encrypts app data
B) Makes code smaller and harder to read
C) Manages UI animations
D) Optimizes layouts
Answer: B

168. Which keyword is used to define a coroutine function in Kotlin?


A) @Thread
B) suspend
C) @Coroutine
D) @Async
Answer: B

169. Where are key-value pairs stored in Android?


A) SQLite database
B) SharedPreferences
C) Room database
D) JSON files
Answer: B

170. Which component is for long-running background tasks?


A) IntentService (deprecated)
B) Foreground Service
C) BroadcastReceiver
D) AsyncTask
Answer: B
171. What is the use of ConstraintSet in ConstraintLayout?
A) To set constraints by code
B) To load images
C) To animate text
D) To manage fragments
Answer: A

172. What does minSdkVersion specify?


A) Minimum Android API level the app supports
B) Target API level
C) Compile SDK version
D) Version code
Answer: A

173. What is the purpose of the Handler class?


A) Run background tasks
B) Send messages or run code on a thread’s message queue
C) Manage database
D) Manage layouts
Answer: B

174. What is an advantage of Kotlin Coroutines over AsyncTask?


A) Easier syntax and better cancellation
B) Faster speed
C) Uses less memory
D) Supports Java 7
Answer: A

175. How do you declare a custom permission in Android?


A) In Manifest: <permission android:name="[Link]" />
B) By Java code
C) By Gradle plugin
D) Using Kotlin coroutines
Answer: A

176. Which Service method is called when the service starts?


A) onStartCommand()
B) onCreate()
C) onDestroy()
D) onBind()
Answer: A

177. Which attribute defines if an activity can be opened from other apps?
A) android:launchMode
B) android:exported
C) android:theme
D) android:configChanges
Answer: B

178. What does the ViewHolder pattern do in RecyclerView?


A) Helps reuse views and avoid repeated findViewById calls
B) Animates items
C) Runs database queries
D) Handles services
Answer: A

179. Which class monitors network connectivity?


A) ConnectivityManager
B) NetworkManager
C) WifiManager
D) ServiceManager
Answer: A

180. On which thread does Retrofit run network calls by default?


A) Main thread
B) Background thread
C) UI thread
D) AsyncTask thread
Answer: B

181. What does android:launchMode="singleTop" mean?


A) Always creates a new instance
B) Reuses existing activity at the top if exists
C) Makes the activity a single global instance
D) Launches in a new task
Answer: B

182. How do you get the current Android version programmatically?


A) [Link]
B) [Link]()
C) [Link]()
D) [Link]()
Answer: A

183. What is ViewPager2 used for?


A) To replace RecyclerView
B) To create swipeable screens or tabs
C) To animate buttons
D) To manage fragments lifecycle
Answer: B

184. Which annotation marks a query method in Room DAO?


A) @Query
B) @Select
C) @Get
D) @Retrieve
Answer: A

185. What is a “cold start” in Android?


A) App opened first time after install
B) App opened after device restart
C) App opened after being in background for some time
D) App opened without internet
Answer: A

186. How do you debug an Android app?


A) Using Logcat and breakpoints
B) Using only Logcat
C) Using Gradle
D) Using Emulator
Answer: A

187. Which tool generates vector assets?


A) Vector Asset Studio
B) Drawable Manager
C) Resource Editor
D) Layout Editor
Answer: A
188. Which file manages app dependencies?
A) [Link]
B) [Link]
C) [Link]
D) [Link]
Answer: B

189. What is the safest way to store sensitive data?


A) SharedPreferences
B) External Storage
C) Android Keystore System
D) Plain text file
Answer: C

190. What does Navigation Component help with?


A) Designing UI layouts
B) Managing app navigation and back stack
C) Animating views
D) Handling permissions
Answer: B

191. Which Kotlin operator safely handles null values?


A) !!
B) ?.
C) ?:
D) let
Answer: B

192. What is the lifecycle scope of a ViewModel?


A) Application lifecycle
B) Activity or Fragment lifecycle
C) Service lifecycle
D) BroadcastReceiver lifecycle
Answer: B

193. Which class does Retrofit use for HTTP calls?


A) RetrofitClient
B) OkHttpClient
C) HttpClient
D) VolleyClient
Answer: B

194. Which Jetpack library helps bind UI components to data?


A) Room
B) Data Binding Library
C) LiveData
D) Navigation
Answer: B

195. Which Activity method saves UI state before being destroyed?


A) onSaveInstanceState()
B) onPause()
C) onDestroy()
D) onStop()
Answer: A

196. Which is NOT an Android lifecycle method?


A) onStart()
B) onResume()
C) onCreate()
D) onLoad()
Answer: D

197. How do you access raw resources?


A) [Link]
B) [Link]
C) [Link]
D) [Link]
Answer: A

198. What is the main advantage of WorkManager?


A) Simplifies background work and manages constraints
B) Animates UI
C) Manages layouts
D) Handles network calls
Answer: A

199. Which Android Studio tool profiles CPU, memory, and network?
A) Logcat
B) Profiler
C) Debugger
D) Emulator
Answer: B

200. What is the maximum APK size on Google Play Store?


A) 100 MB
B) 150 MB
C) 200 MB
D) 50 MB
Answer: A

You might also like