Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
79 views

Android 100 MCQS

mobile app development
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Android 100 MCQS

mobile app development
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Core Android Concepts:

1. Ques What is Android?


- A. A programming language
- B. A mobile device manufacturer
- C. An operating system
- D. A software development framework

2. Ques What is the Android Open Source Project (AOSP)?


- A. An open-source app
- B. A development IDE
- C. The source code for the Android operating system
- D. A hardware device

3. Ques What is the role of the Android Debug Bridge (ADB)?


- A. Device charging
- B. Device communication
- C. Debugging and communication with an Android device
- D. Android application distribution

4. Ques What is the purpose of the AndroidManifest.xml file?


- A. Manage app permissions
- B. Define app layouts
- C. Handle background tasks
- D. Store app data
5. Ques What is the Dalvik Virtual Machine (DVM)?
- A. A hardware device
- B. A software development tool
- C. A virtual machine for running Android applications
- D. An Android emulator

Android UI/UX:

6. Ques What is the purpose of the layout file in Android?


- A. Store app data
- B. Define the user interface structure
- C. Manage background tasks
- D. Control device hardware

7. Ques What is the function of the `findViewById` method?


- A. Find a file in the system
- B. Find a view in the layout by its ID
- C. Find an activity in the app
- D. Find a background process

8. Ques What is a `View` in Android?


- A. A file in the app directory
- B. A background process
- C. The main application component
- D. A UI element or widget
9. Ques What is the purpose of the `RecyclerView` in Android?
- A. Display a list of items efficiently
- B. Record audio
- C. Manage background tasks
- D. Control device orientation

10. Ques In Android, what is a `Toast`?


- A. A background service
- B. A UI element for displaying short messages
- C. A type of layout
- D. An input method

Android Activities and Fragments:

11. Ques What is an Android Activity?


- A. A UI element
- B. A modular section of an app
- C. A background process
- D. The main building block of an app's user interface

12. Ques How can you pass data between activities in Android?
- A. Using SharedPreferences
- B. Using Intent extras
- C. Using a global variable
- D. Using the SQLite database
13. Ques What is the purpose of an Android Fragment?
- A. Manage background tasks
- B. Handle device orientation changes
- C. Represent a screen or a part of the user interface
- D. Control device hardware

14. Ques What is the role of the `FragmentManager` in Android?


- A. Manage app permissions
- B. Manage network connections
- C. Manage fragments within an activity
- D. Manage UI layouts

15. Ques How is the `onSaveInstanceState` method used in Android?


- A. Save the current state of the app for future use
- B. Save the app layout
- C. Save background processes
- D. Save UI elements

Android Services:

16. Ques What is an Android Service?


- A. A UI element
- B. A background process that runs independently
- C. A type of layout
- D. A type of intent
17. Ques What is the primary purpose of an Android Service?
- A. Handle background tasks
- B. Manage user interactions with the app
- C. Control device hardware
- D. Store data persistently

18. Ques How can you communicate between an Activity and a Service in Android?
- A. Using a global variable
- B. Using Intents
- C. Using SharedPreferences
- D. Using the SQLite database

19. Ques What is an IntentService in Android?


- A. A service for handling user interactions
- B. A service for handling background tasks on a separate thread
- C. An activity that handles intents
- D. A type of layout in Android

20. Ques What is a Bound Service in Android?


- A. A service that runs independently
- B. A service that binds to an activity and allows communication
- C. A service for handling UI elements
- D. A type of background process

Android Broadcast Receivers:


21. Ques What is an Android BroadcastReceiver?
- A. A UI element
- B. A background process
- C. A modular section of an app
- D. A component that responds to system-wide broadcast announcements

22. Ques How is a BroadcastReceiver declared in the AndroidManifest.xml file?


- A. Inside the `<activity>` tag
- B. Inside the `<service>` tag
- C. Inside the `<broadcast-receiver>` tag
- D. Inside the `<layout>` tag

23. Ques What is the purpose of the `sendBroadcast` method in Android?


- A. Send a UI element to another activity
- B. Send a broadcast message to all interested components
- C. Send an intent to a service
- D. Send data to a content provider

24. Ques How can you register a BroadcastReceiver dynamically in an Android app?
- A. Using the `<receiver>` tag in the AndroidManifest.xml file
- B. Using the `registerReceiver` method in code
- C. Using Intents
- D. Using SharedPreferences

25. Ques What is the difference between an ordered and unordered broadcast in
Android?
- A. Ordered broadcasts are asynchronous, and unordered broadcasts are
synchronous
- B. Ordered broadcasts guarantee the order of delivery, unordered broadcasts do not
- C. Ordered broadcasts are more efficient
- D. There is no difference

Android Data Storage:

26. Ques What is SQLite in the context of Android?


- A. A UI element
- B. A background process
- C. A relational database management system
- D. A file storage system

27. Ques How can you perform database operations in Android?


- A. Using the `SharedPreferences` class
- B. Using the `DatabaseHelper` class
- C. Using the `Intent` class
- D. Using the `BroadcastReceiver` class

28. Ques What is the

purpose of the `ContentProvider` in Android?


- A. Manage UI layout
- B. Share data between apps
- C. Handle background tasks
- D. Define app permissions

29. Ques How does Android's `SharedPreferences` work?


- A. It stores data in a SQLite database
- B. It stores data as key-value pairs in XML files
- C. It stores data in a content provider
- D. It stores data in an external server

30. Ques What is the difference between internal and external storage in Android?
- A. Internal storage is faster
- B. External storage is non-removable, while internal storage is removable
- C. Internal storage is always private to the app, external storage is shared
- D. There is no difference

Android Networking:

31. Ques What is the purpose of the Android `AsyncTask` class?


- A. Manage UI layout
- B. Perform background tasks on a separate thread
- C. Handle device orientation changes
- D. Define app permissions

32. Ques How can you perform network operations in Android?


- A. Using the `NetworkManager` class
- B. Using the `IntentService` class
- C. Using the `Retrofit` library
- D. Using the `BroadcastReceiver` class

33. Ques What is the purpose of the Android `HttpURLConnection` class?


- A. Manage UI layout
- B. Perform HTTP network operations
- C. Handle background tasks
- D. Define app permissions

34. Ques What is JSON in the context of Android?


- A. A UI element
- B. A background process
- C. A data interchange format
- D. A database system

35. Ques What is the role of the Android `WebView` component?


- A. Display web pages within an app
- B. Manage background tasks
- C. Control device orientation
- D. Define app permissions

Android Security:

36. Ques What is ProGuard in Android?


- A. A security library
- B. A code obfuscation tool
- C. A UI element
- D. A background process

37. Ques How can you secure sensitive data in Android?


- A. Store data in a public directory
- B. Use the `SharedPreferences` class
- C. Encrypt the data using algorithms like AES
- D. Use the `IntentService` class

38. Ques What is Android's permissions system used for?


- A. Manage UI layout
- B. Control device hardware
- C. Define access to system resources and data
- D. Handle background tasks

39. Ques What is the purpose of the Android KeyStore?


- A. Manage UI layout
- B. Store cryptographic keys in a container
- C. Handle background tasks
- D. Define app permissions

40. Ques How can you prevent security vulnerabilities like SQL injection in Android?
- A. Use the `WebView` component
- B. Sanitize user inputs and use parameterized queries
- C. Use the `AsyncTask` class
- D. Use the `BroadcastReceiver` class
Android Multithreading:

41. Ques Why is it important to perform network operations on a separate thread in


Android?
- A. To reduce battery consumption
- B. To improve app performance and responsiveness
- C. To simplify code
- D. To handle device orientation changes

42. Ques What is the purpose of the Android `Handler` class?


- A. Manage UI layout
- B. Perform background tasks
- C. Communicate between threads
- D. Define app permissions

43. Ques How can you run a task periodically in Android?


- A. Use the `AsyncTask` class
- B. Use the `IntentService` class
- C. Use the `Handler` class with `postDelayed`
- D. Use the `BroadcastReceiver` class

44. Ques What is the purpose of the `runOnUiThread` method in Android?


- A. Run a task in the background
- B. Run a task on the main thread from a background thread
- C. Define app permissions
- D. Handle device orientation changes
45. Ques What is the purpose of the `Looper` class in Android?
- A. Manage UI layout
- B. Control device hardware
- C. Provide a message loop for threads
- D. Define app permissions

Android Intent System:

46. Ques What is an Android Intent?


- A. A UI element
- B. A background process
- C. A message that components can use to communicate
- D. A modular section of an app

47. Ques What is an explicit Intent in Android?


- A. An intent that explicitly specifies the component to start
- B. An intent that is declared in the AndroidManifest.xml file
- C. An intent for background tasks
- D. An intent for UI layout

48. Ques What is an implicit Intent in Android?


- A. An intent that explicitly specifies the component to start
- B. An intent that is declared in the AndroidManifest.xml file
- C. An intent that does not specify the component to start
- D. An intent for background tasks
49. Ques How can you start a new activity using an Intent in Android?
- A. Using the `startService` method
- B. Using the `startActivity` method
- C. Using the `bindService` method
- D. Using the `sendBroadcast` method

50. Ques What is the purpose of Intent filters in Android?


- A. Manage UI layout
- B. Specify the types of intents that a component can respond to
- C. Handle background tasks
- D. Define app permissions

Android Lifecycle:

51. Ques What is the Android Activity lifecycle?


- A. The sequence of methods called when an activity is created, started, resumed,
paused, stopped, and destroyed
- B. The sequence of methods called when a service is started and stopped
- C. The sequence of methods called when a broadcast receiver is registered and
unregistered
- D. The sequence of methods called when an app is installed and uninstalled

52. Ques What is the purpose of the `onCreate` method in an Android Activity?
- A. Initialize the activity and load UI elements
- B. Handle device orientation changes
- C. Perform background tasks
- D. Define app permissions

53. Ques When is the `onStart` method called in the Android Activity lifecycle?
- A. After `onCreate`
- B. After `onPause`
- C. After `onStop`
- D.

After `onResume`

54. Ques What is the purpose of the `onPause` method in an Android Activity?
- A. Perform background tasks
- B. Save the current state of the activity
- C. Initialize the activity
- D. Define app permissions

55. Ques When is the `onDestroy` method called in the Android Activity lifecycle?
- A. Before `onCreate`
- B. Before `onPause`
- C. Before `onStop`
- D. Before `onResume`

Android Fragments:

56. Ques What is the Android Fragment lifecycle?


- A. The sequence of methods called when a fragment is created, attached, resumed,
paused, detached, and destroyed
- B. The sequence of methods called when a service is started and stopped
- C. The sequence of methods called when a broadcast receiver is registered and
unregistered
- D. The sequence of methods called when an app is installed and uninstalled

57. Ques What is the purpose of the `onCreateView` method in an Android Fragment?
- A. Perform background tasks
- B. Initialize the fragment and load UI elements
- C. Save the current state of the fragment
- D. Define app permissions

58. Ques When is the `onAttach` method called in the Android Fragment lifecycle?
- A. Before `onCreate`
- B. Before `onCreateView`
- C. Before `onResume`
- D. Before `onDetach`

59. Ques What is the purpose of the `onPause` method in an Android Fragment?
- A. Perform background tasks
- B. Save the current state of the fragment
- C. Initialize the fragment
- D. Define app permissions

60. Ques How can you communicate between two Fragments in an Activity?
- A. Using shared preferences
- B. Using a global variable
- C. Using Intents
- D. Using interface callbacks

Android RecyclerView:

61. Ques What is the purpose of the Android `RecyclerView`?


- A. Manage UI layout
- B. Display a scrollable list of items efficiently
- C. Handle background tasks
- D. Define app permissions

62. Ques What is the difference between `RecyclerView` and `ListView` in Android?
- A. `RecyclerView` is for displaying grids, `ListView` for lists
- B. `RecyclerView` is more flexible and efficient than `ListView`
- C. `RecyclerView` is older than `ListView`
- D. There is no difference

63. Ques What is an Adapter in the context of Android's `RecyclerView`?


- A. A UI element
- B. A background process
- C. A component for managing network connections
- D. A component that acts as a bridge between the data source and the
`RecyclerView`
64. Ques How can you implement item click events in a `RecyclerView`?
- A. Use the `onClick` method in the adapter
- B. Use the `onItemClick` method in the `RecyclerView` class
- C. Use the `setOnItemClickListener` method
- D. Use the `OnClickListener` interface in the adapter

65. Ques What is the purpose of the `ViewHolder` pattern in Android's `RecyclerView`?
- A. Manage UI layout
- B. Improve the performance of the `RecyclerView` by reusing views
- C. Handle background tasks
- D. Define app permissions

Android Architecture Components:

66. Ques What is the purpose of the Android Architecture Components?


- A. Manage UI layout
- B. Provide a set of libraries that help you design robust, testable, and maintainable
apps
- C. Handle background tasks
- D. Define app permissions

67. Ques What is the role of the `ViewModel` in Android Architecture Components?
- A. Manage UI layout
- B. Store and manage UI-related data, ensuring data survives configuration changes
- C. Handle network operations
- D. Define app permissions
68. Ques What is the purpose of LiveData in Android Architecture Components?
- A. Manage background tasks
- B. Observe and react to changes in the app's data
- C. Handle user interactions
- D. Define app navigation

69. Ques What is Room in the context of Android Architecture Components?


- A. A UI element
- B. A database library that provides an abstraction layer over SQLite
- C. A background service
- D. A type of layout in Android

70. Ques How does the Repository pattern work in Android Architecture Components?
- A. Manage UI layout
- B. Abstract the data source from the rest of the app, providing a clean API for data
access
- C. Handle background tasks
- D. Define app permissions

Android ViewModel and LiveData:

71. Ques How does the `ViewModel` survive configuration changes in Android?
- A. It is reinitialized
- B. It is saved in the savedInstanceState
- C. It is recreated using a `ViewModelProvider`
- D. It is destroyed and recreated from scratch

72. Ques What is the purpose of the `onCleared` method in the Android `ViewModel`?
- A. Manage UI layout
- B. Called when the `ViewModel` is no longer used and will be destroyed
- C. Handle background tasks
- D. Define app permissions

73. Ques What is the difference between `LiveData` and `Observable` in Android?
- A. There is no difference
- B. `LiveData` is part of the Android Architecture Components, while `Observable` is
not
- C. `Observable` is used for UI updates, `LiveData` is not
- D. `Observable` is used for background tasks, `LiveData` is used for UI updates

74. Ques How can you observe `LiveData` in an Android app?


- A. Using a global variable
- B. Using the `observe` method in an `Observer` class
- C. Using the `startObserving` method
- D. Using `SharedPreferences`

75. Ques What is the purpose of the `Transformations` class in Android's `LiveData`?
- A. Manage UI layout
- B. Perform transformations on `LiveData` objects
- C. Handle background tasks
- D. Define app permissions
Android Room Database:

76. Ques What is the purpose of the Room Persistence Library in Android?
- A. Manage UI layout
- B. Provide an abstraction layer over SQLite to allow for more robust database access
- C. Handle background tasks
- D. Define app permissions

77. Ques How can you define an entity in a Room database?


- A. By creating a Java class and annotating it with `@Entity`
- B.

By creating a layout file


- C. By using the `RoomEntity` class
- D. By using the `DatabaseEntity` class

78. Ques What is the role of the `@PrimaryKey` annotation in a Room database entity?
- A. Manage UI layout
- B. Define a primary key for the entity
- C. Handle background tasks
- D. Define app permissions

79. Ques How can you perform CRUD (Create, Read, Update, Delete) operations in a
Room database?
- A. Using the `IntentService` class
- B. Using the `BroadcastReceiver` class
- C. Using the `RoomDatabase` class
- D. Using the `RoomDAO` interface

80. Ques What is the purpose of the `@Query` annotation in a Room database DAO
(Data Access Object)?
- A. Manage UI layout
- B. Define a database query
- C. Handle background tasks
- D. Define app permissions

Android Navigation:

81. Ques What is the purpose of the Android Navigation Component?


- A. Manage UI layout
- B. Provide a framework for implementing navigation between destinations in an app
- C. Handle background tasks
- D. Define app permissions

82. Ques What is a NavHostFragment in Android Navigation?


- A. A UI element
- B. A background process
- C. A fragment that acts as a host for destinations within a navigation graph
- D. A type of layout in Android
83. Ques How can you navigate between destinations using the Navigation
Component?
- A. Using the `startActivity` method
- B. Using the `IntentService` class
- C. Using the `NavController` and `NavHostFragment`
- D. Using the `BroadcastReceiver` class

84. Ques What is a navigation graph in the Android Navigation Component?


- A. A UI element
- B. A background process
- C. A visual representation of the app's navigation flow
- D. A type of layout in Android

85. Ques How can you pass data between destinations in Android Navigation?
- A. Using shared preferences
- B. Using the `IntentService` class
- C. Using the `NavController` and Safe Args
- D. Using the `BroadcastReceiver` class

Android Testing:

86. Ques What is the purpose of Android testing libraries like Espresso and JUnit?
- A. Manage UI layout
- B. Provide a framework for testing Android applications
- C. Handle background tasks
- D. Define app permissions
87. Ques What is Espresso in the context of Android testing?
- A. A UI element
- B. A background process
- C. A testing framework for UI testing
- D. A type of layout in Android

88. Ques How can you write a UI test using Espresso in Android?
- A. By creating a new activity
- B. By writing test cases using the `ActivityTestRule` and `Espresso` classes
- C. By using the `IntentService` class
- D. By using the `BroadcastReceiver` class

89. Ques What is the purpose of the `@RunWith` annotation in JUnit in Android
testing?
- A. Manage UI layout
- B. Specify the test runner class
- C. Handle background tasks
- D. Define app permissions

90. Ques How can you perform unit testing in Android using JUnit?
- A. By creating a new activity
- B. By writing test cases for individual units of code using JUnit
- C. By using the `IntentService` class
- D. By using the `BroadcastReceiver` class
Android Broadcasts:

91. Ques What is an Android Broadcast?


- A. A UI element
- B. A background process
- C. A system-wide message
- D. A type of layout in Android

92. Ques What is the purpose of the `sendBroadcast` method in Android?


- A. Send a UI element to another activity
- B. Send a broadcast message to all interested components
- C. Send an intent to a service
- D. Send data to a content provider

93. Ques What is a Sticky Broadcast in Android?


- A. A UI element that remains on the screen
- B. A type of layout
- C. A broadcast that stays available for future broadcasts
- D. A background process

94. Ques How can you register a BroadcastReceiver dynamically in an Android app?
- A. Using the `<receiver>` tag in the AndroidManifest.xml file
- B. Using the `registerReceiver` method in code
- C. Using Intents
- D. Using SharedPreferences
95. Ques What is the difference between a local and global broadcast in Android?
- A. Local broadcasts are sent within the app, global broadcasts are system-wide
- B. Global broadcasts are sent within the app, local broadcasts are system-wide
- C. There is no difference
- D. Local broadcasts are synchronous, global broadcasts are asynchronous

Android Background Processing:

96. Ques What is the purpose of the Android `JobIntentService` class?


- A. Manage UI layout
- B. Provide a simple mechanism for running background tasks in a service
- C. Handle device orientation changes
- D. Define app permissions

97. Ques How can you schedule background tasks in Android?


- A. Using the `IntentService` class
- B. Using the `JobIntentService` class
- C. Using the `Handler` class
- D. Using the `BroadcastReceiver` class

98. Ques What is Firebase Cloud Messaging (FCM) used for in Android?
- A. Manage UI layout
- B. Send and receive push notifications
- C. Handle background tasks
- D. Define app permissions
99. Ques What is the Android WorkManager used for?
- A. Manage UI layout
- B. Perform background tasks in a way that is both guaranteed to execute and
deferrable
- C. Handle device orientation changes
- D. Define app permissions

100. Ques What is the purpose of the Android `AsyncTaskLoader` class?


- A. Manage UI layout
- B. Load data asynchronously and persist across configuration changes
- C. Handle background tasks
- D. Define app permissions

Android Dependency Injection:

101. Ques What is Dependency Injection in Android?


- A. A UI element
- B. A design pattern where components are given their dependencies
- C. A background process
- D. A type of layout in Android

102. Ques What is Dagger 2 in the context of Android?


- A. A UI element
- B.

A dependency injection framework for Android and Java


- C. A background process
- D. A type of layout in Android

103. Ques How can you use Dagger 2 for Dependency Injection in an Android app?
- A. By creating a new activity
- B. By writing custom code to manage dependencies
- C. By using the `@Inject` annotation and defining a module
- D. By using the `IntentService` class

104. Ques What is the role of the `@Inject` annotation in Dagger 2?


- A. Manage UI layout
- B. Specify a dependency that should be provided by Dagger
- C. Handle background tasks
- D. Define app permissions

105. Ques What is the purpose of a Dagger 2 module in Android?


- A. Manage UI layout
- B. Provide information to Dagger about how to satisfy a dependency
- C. Handle background tasks
- D. Define app permissions

Android Design Patterns:

106. Ques What is the Singleton design pattern?


- A. A UI element
- B. A design pattern where a class has only one instance and provides a global point
of access to it
- C. A background process
- D. A type of layout in Android

107. Ques How is the Observer design pattern implemented in Android?


- A. By using the `BroadcastReceiver` class
- B. By using the `Observer` interface and `Observable` class
- C. By using the `IntentService` class
- D. By using shared preferences

108. Ques What is the ViewHolder design pattern used for in Android?
- A. Manage UI layout
- B. Improve the performance of `RecyclerView` by reusing views
- C. Handle background tasks
- D. Define app permissions

109. Ques What is the Builder design pattern?


- A. A UI element
- B. A design pattern where an object is constructed step by step
- C. A background process
- D. A type of layout in Android

110. Ques How is the Factory design pattern implemented in Android?


- A. By using the `Factory` class
- B. By using the `IntentService` class
- C. By using the `BroadcastReceiver` class
- D. By using interfaces and concrete implementations

Android MVVM Architecture:

111. Ques What is MVVM in the context of Android architecture?


- A. A UI element
- B. Model-View-ViewModel, a design pattern that separates the user interface from
the business logic
- C. A background process
- D. A type of layout in Android

112. Ques What is the purpose of the ViewModel in MVVM architecture?


- A. Manage UI layout
- B. Store and manage UI-related data, ensuring data survives configuration changes
- C. Handle network operations
- D. Define app permissions

113. Ques How does data binding work in Android MVVM?


- A. By using `IntentService` class
- B. By using the `BroadcastReceiver` class
- C. By establishing a connection between UI components and data sources
- D. By using the `Retrofit` library

114. Ques What is the role of the Repository in Android MVVM?


- A. Manage UI layout
- B. Abstract the data source from the rest of the app, providing a clean API for data
access
- C. Handle background tasks
- D. Define app permissions

115. Ques How does MVVM help in unit testing Android apps?
- A. By providing a clear separation of concerns
- B. By using `IntentService` class
- C. By using the `BroadcastReceiver` class
- D. By using shared preferences

Android Kotlin:

116. Ques What is Kotlin?


- A. A UI element
- B. A programming language for developing Android apps
- C. A background process
- D. A type of layout in Android

117. Ques How does Kotlin differ from Java in the context of Android development?
- A. Kotlin is a markup language, while Java is a programming language
- B. Kotlin is more concise and expressive than Java
- C. Kotlin is an older language than Java
- D. There is no difference

118. Ques What is the purpose of the Kotlin `null` safety feature?
- A. Manage UI layout
- B. Prevent null pointer exceptions by making types non-nullable by default
- C. Handle background tasks
- D. Define app permissions

119. Ques How can you declare a variable as nullable in Kotlin?


- A. Using the `var` keyword
- B. Using the `let` keyword
- C. Using the `?` symbol after the type
- D. Using the `fun` keyword

120. Ques What is a Kotlin coroutine in Android?


- A. A UI element
- B. A design pattern

- C. A background process that can run independently of other code


- D. A type of layout in Android

Android Jetpack Compose:

121. Ques What is Android Jetpack Compose?


- A. A UI element
- B. A design pattern
- C. A modern Android UI toolkit for building native UIs
- D. A type of layout in Android
122. Ques How does Jetpack Compose differ from the traditional XML-based UI
development in Android?
- A. Jetpack Compose is older than XML-based UI development
- B. Jetpack Compose uses a declarative syntax, while XML-based UI is imperative
- C. There is no difference
- D. Jetpack Compose is only used for games

123. Ques What is the purpose of the `@Composable` annotation in Jetpack Compose?
- A. Manage UI layout
- B. Specify a composable function that defines a part of the UI
- C. Handle background tasks
- D. Define app permissions

124. Ques How can you create a button in Jetpack Compose?


- A. By using the `<Button>` tag in XML
- B. By using the `Button` class in Java or Kotlin
- C. By creating a composable function with the `Button` element
- D. By using the `IntentService` class

125. Ques What is the purpose of the `remember` function in Jetpack Compose?
- A. Manage UI layout
- B. Save and restore UI-related data across recompositions
- C. Handle background tasks
- D. Define app permissions
Android Kotlin Coroutines:

126. Ques What are Kotlin Coroutines?


- A. A UI element
- B. A design pattern
- C. A way to perform asynchronous and concurrent programming in Kotlin
- D. A type of layout in Android

127. Ques How do Kotlin Coroutines differ from traditional threading approaches?
- A. Kotlin Coroutines are slower than traditional threading
- B. Kotlin Coroutines use cooperative multitasking and can be more efficient than
traditional threading
- C. There is no difference
- D. Kotlin Coroutines are only used for UI tasks

128. Ques What is the purpose of the `suspend` keyword in Kotlin Coroutines?
- A. Manage UI layout
- B. Specify a coroutine that can be suspended and resumed later
- C. Handle background tasks
- D. Define app permissions

129. Ques How can you launch a coroutine in Kotlin?


- A. Using the `IntentService` class
- B. Using the `launch` builder function
- C. Using the `BroadcastReceiver` class
- D. Using the `startCoroutine` method
130. Ques What is the `CoroutineScope` in Kotlin Coroutines?
- A. A UI element
- B. A design pattern
- C. A context that defines the lifetime of coroutines
- D. A type of layout in Android

Android WorkManager:

131. Ques What is WorkManager in Android?


- A. A UI element
- B. A design pattern
- C. A library for managing background tasks that need guaranteed execution
- D. A type of layout in Android

132. Ques How does WorkManager differ from other background processing solutions
in Android?
- A. WorkManager is only used for UI tasks
- B. WorkManager is part of the Android Architecture Components and provides a
simple and consistent API
- C. There is no difference
- D. WorkManager is an older technology than other solutions

133. Ques What types of constraints can you apply to a task scheduled with
WorkManager?
- A. Only time constraints
- B. Only network constraints
- C. Time, network, storage, and charging constraints
- D. There are no constraints in WorkManager

134. Ques How can you create a periodic task with WorkManager?
- A. By using the `IntentService` class
- B. By using the `JobIntentService` class
- C. By using the `WorkManager` and `PeriodicWorkRequest` classes
- D. By using the `BroadcastReceiver` class

135. Ques What is the purpose of the `Worker` class in WorkManager?


- A. A UI element
- B. A design pattern
- C. A class that performs background work and is managed by WorkManager
- D. A type of layout in Android

Android Firebase:

136. Ques What is Firebase in the context of Android development?


- A. A UI element
- B. A design pattern
- C. A platform provided by Google for creating mobile and web applications
- D. A type of layout in Android

137. Ques How can you integrate Firebase into an Android app?
- A. By creating a new activity
- B. By adding the Firebase SDK to the app and configuring it
- C. By using the `IntentService` class
- D. By using the `BroadcastReceiver` class

138. Ques What is Firebase Cloud Firestore used for?


- A. Manage UI layout
- B. Store and sync data in real-time in a NoSQL cloud database
- C. Handle background tasks
- D. Define app permissions

139. Ques How can you perform authentication using Firebase in Android?
- A. By using the `IntentService` class
- B. By using the `FirebaseAuth` class and related components
- C. By using the `BroadcastReceiver` class
- D. By using the `Room` database

140. Ques What is Firebase Cloud Messaging (FCM) used for?


- A. Manage UI layout
- B. Send and receive push notifications
- C. Handle background tasks
- D. Define app permissions

Android Room Database:

141. Ques What is the purpose of the Room Persistence Library in Android?
- A. Manage UI layout
- B. Provide an abstraction layer over SQLite to allow for more robust database access
- C. Handle background tasks
- D. Define app permissions

142. Ques How can you define an entity in a Room database?


- A. By creating a Java class and annotating it with `@Entity`
- B. By creating a layout file
- C. By using the `RoomEntity` class
- D. By using the `DatabaseEntity` class

143. Ques What is the role of the `@PrimaryKey` annotation in a Room database
entity?
- A. Manage UI layout
- B. Define a primary key for the entity
- C. Handle background tasks
- D. Define app permissions

144. Ques How can you perform CRUD (Create, Read, Update, Delete) operations in a
Room database

?
- A. Using the `IntentService` class
- B. Using the `BroadcastReceiver` class
- C. Using the `RoomDatabase` class
- D. Using the `RoomDAO` interface

145. Ques What is the purpose of the `@Query` annotation in a Room database DAO
(Data Access Object)?
- A. Manage UI layout
- B. Define a database query
- C. Handle background tasks
- D. Define app permissions

Android Unit Testing:

146. Ques What is the purpose of Android testing libraries like Espresso and JUnit?
- A. Manage UI layout
- B. Provide a framework for testing Android applications
- C. Handle background tasks
- D. Define app permissions

147. Ques What is Espresso in the context of Android testing?


- A. A UI element
- B. A background process
- C. A testing framework for UI testing
- D. A type of layout in Android

148. Ques How can you write a UI test using Espresso in Android?
- A. By creating a new activity
- B. By writing test cases using the `ActivityTestRule` and `Espresso` classes
- C. By using the `IntentService` class
- D. By using the `BroadcastReceiver` class
149. Ques What is the purpose of the `@RunWith` annotation in JUnit in Android
testing?
- A. Manage UI layout
- B. Specify the test runner class
- C. Handle background tasks
- D. Define app permissions

150. Ques How can you perform unit testing in Android using JUnit?
- A. By creating a new activity
- B. By writing test cases for individual units of code using JUnit
- C. By using the `IntentService` class
- D. By using the `BroadcastReceiver` class

You might also like