Certified Android Apps Developer Practice Exam, Exams of Technology

Designed for aspiring Android app developers, this practice exam tests knowledge in Android app development, including UI design, backend integration, Android SDK, and security best practices. It also covers advanced topics like app performance optimization and Android architecture components.

Typology: Exams

2025/2026

Available from 12/24/2025

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 90

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Certified Android Apps Developer Practice
Exam
**Question 1. What is the primary role of the AndroidManifest.xml file?**
A) Defines UI layouts
B) Declares app components and required permissions
C) Stores string resources
D) Configures Gradle build scripts
Answer: B
Explanation: The manifest declares activities, services, receivers, providers, and the permissions
the app needs, serving as the app’s central declaration file.
**Question 2. In a Gradle module, which property sets the API level used to compile the app?**
A) minSdkVersion
B) targetSdkVersion
C) compileSdkVersion
D) versionCode
Answer: C
Explanation: compileSdkVersion determines the Android SDK version against which the app is
compiled, giving access to the latest APIs.
**Question 3. Which Gradle configuration is used to add a library that is required only at
compile time and not packaged in the APK?**
A) implementation
B) api
C) compileOnly
D) runtimeOnly
Answer: C
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a

Partial preview of the text

Download Certified Android Apps Developer Practice Exam and more Exams Technology in PDF only on Docsity!

Exam

Question 1. What is the primary role of the AndroidManifest.xml file? A) Defines UI layouts B) Declares app components and required permissions C) Stores string resources D) Configures Gradle build scripts Answer: B Explanation: The manifest declares activities, services, receivers, providers, and the permissions the app needs, serving as the app’s central declaration file. Question 2. In a Gradle module, which property sets the API level used to compile the app? A) minSdkVersion B) targetSdkVersion C) compileSdkVersion D) versionCode Answer: C Explanation: compileSdkVersion determines the Android SDK version against which the app is compiled, giving access to the latest APIs. Question 3. Which Gradle configuration is used to add a library that is required only at compile time and not packaged in the APK? A) implementation B) api C) compileOnly D) runtimeOnly Answer: C

Exam

Explanation: compileOnly adds a dependency for compilation only; it is not included in the final APK. Question 4. In Kotlin, what does the Elvis operator (?:) do? A) Forces a null pointer exception B) Provides a default value when an expression is null C) Performs a safe cast D) Executes a lambda only if the value is non‑null Answer: B Explanation: The Elvis operator returns the left‑hand expression if it’s non‑null; otherwise it returns the right‑hand default value. Question 5. Which of the following correctly declares a nullable variable in Kotlin? A) var name: String = null B) var name: String? = null C) var name: String! = null D) var name = null as String Answer: B Explanation: Adding a? after the type makes the variable nullable, allowing it to hold null. Question 6. Which coroutine builder should be used when you need a result returned from a background computation? A) launch B) async C) runBlocking D) withContext

Exam

B) Service C) ViewModel D) BroadcastReceiver Answer: C Explanation: ViewModel is scoped to the UI controller’s lifecycle and retains its data across configuration changes. Question 10. Which LiveData method should you use to observe data changes in a LifecycleOwner? A) observeForever() B) postValue() C) observe(owner, observer) D) setValue() Answer: C Explanation: observe(owner, observer) ties the observation to the LifecycleOwner, automatically removing observers when the lifecycle is destroyed. Question 11. What is the main advantage of using StateFlow over LiveData in a Compose UI? A) It runs on the main thread only B) It provides a cold stream that starts only when collected C) It integrates directly with the Compose recomposition system D) It does not support back‑pressure handling Answer: C Explanation: StateFlow is a Kotlin Flow that is lifecycle‑aware and works seamlessly with Compose’s collectAsState, triggering recompositions.

Exam

Question 12. Which annotation is required to enable Hilt dependency injection in an Android Application class? A) @Inject B) @HiltAndroidApp C) @AndroidEntryPoint D) @Module Answer: B Explanation: @HiltAndroidApp triggers Hilt’s code generation and sets up the dependency container for the app. Question 13. In a Repository pattern, where should the decision about which data source (network or cache) to use be made? A) In the ViewModel B) In the Repository C) In the UI layer D) In the Activity Answer: B Explanation: The Repository abstracts data sources, deciding whether to fetch from remote or local caches. Question 14. Which layout is recommended for creating flat, flexible UI hierarchies with constraint‑based positioning? A) LinearLayout B) FrameLayout C) ConstraintLayout

Exam

A) Modifier.align(Alignment.Center) B) Modifier.center() C) Modifier.gravity(Gravity.Center) D) Modifier.layoutGravity(Gravity.CENTER) Answer: A Explanation: Modifier.align(Alignment.Center) positions the composable at the center within its parent layout. Question 18. What triggers recomposition of a composable function in Compose? A) Any change in the AndroidManifest B) Modification of a State object read by that composable C) A new Activity instance D) Changing the device orientation only Answer: B Explanation: When a State value read by a composable changes, Compose schedules recomposition of that composable and its children. Question 19. Which Jetpack library provides a single‑activity navigation host for Compose? A) Navigation Component (androidx.navigation) B) NavController for Views only C) FragmentManager D) ActivityResultContracts Answer: A Explanation: The Navigation Component includes a Compose‑compatible NavHost and NavController for declarative navigation.

Exam

Question 20. Which lifecycle method is called when an activity becomes visible but not yet interactive? A) onCreate() B) onStart() C) onResume() D) onPause() Answer: B Explanation: onStart() is invoked after onCreate() when the activity is becoming visible to the user. Question 21. Which method should you override to save transient UI state before an activity may be destroyed? A) onPause() B) onStop() C) onSaveInstanceState() D) onDestroy() Answer: C Explanation: onSaveInstanceState() receives a Bundle where you can store UI state that the system restores later. Question 22. When launching an activity for a result using the new Activity Result API, which class is used to register the callback? A) startActivityForResult() B) ActivityResultLauncher C) IntentSender D) PendingIntent

Exam

B) Sticky broadcast C) Ordered broadcast D) Local broadcast Answer: C Explanation: Ordered broadcasts are sent to receivers sequentially based on priority, allowing each to abort propagation. Question 26. Which method registers a BroadcastReceiver dynamically in code? A) registerReceiver() B) addReceiver() C) bindReceiver() D) attachReceiver() Answer: A Explanation: registerReceiver(receiver, filter) registers a receiver at runtime; the opposite is unregisterReceiver. Question 27. In Room, which annotation marks a Kotlin data class as a table entity? A) @Dao B) @Database C) @Entity D) @Table Answer: C Explanation: @Entity defines a SQLite table and maps the class fields to columns. Question 28. Which DAO annotation is used to retrieve a list of items as a Flow?

Exam

A) @Query returning Flow<List> B) @Insert returning Flow C) @Update returning Flow D) @Delete returning Flow Answer: A Explanation: Annotating a method with @Query and returning Flow<List<T>> provides reactive stream updates from the database. Question 29. How does Room handle migrations when the database schema version changes? A) It automatically updates without code B) You must provide a Migration object that defines SQL statements C) It deletes all existing data D) It creates a new database file with a different name Answer: B Explanation: Developers supply a Migration object with migrate() implementation to transform old tables to the new schema. Question 30. Which Android API provides a type‑safe, asynchronous key‑value storage solution that replaces SharedPreferences? A) EncryptedSharedPreferences B) DataStore (Preferences) C) SQLiteOpenHelper D) FileProvider Answer: B

Exam

C) WRITE_CONTACTS

D) MANAGE_CONTACTS

Answer: A Explanation: android.permission.READ_CONTACTS grants read access to the contacts database. Question 34. In Retrofit, which annotation specifies that a method parameter should be added to the request body as JSON? A) @Path B) @Query C) @Field D) @Body Answer: D Explanation: @Body tells Retrofit to serialize the parameter (usually with a converter like Moshi or Gson) into the request body. Question 35. What is the purpose of an OkHttp Interceptor? A) To convert JSON to Kotlin objects B) To add, modify, or log HTTP requests and responses C) To schedule background work D) To manage database migrations Answer: B Explanation: Interceptors can inspect, rewrite, and log network traffic before it reaches the server or after a response is received. Question 36. Which HTTP response code indicates that the client’s request is malformed?

Exam

A) 200

B) 301

C) 400

D) 500

Answer: C Explanation: 400 Bad Request signals that the server could not understand the request due to invalid syntax. Question 37. Which Android API allows you to check whether the device currently has an active internet connection? A) ConnectivityManager.getActiveNetworkInfo() (deprecated) B) NetworkCapabilities.hasCapability() via ConnectivityManager C) WifiManager.isWifiEnabled() D) BluetoothAdapter.isEnabled() Answer: B Explanation: Using ConnectivityManager.getNetworkCapabilities(network) and checking NetworkCapabilities.NET_CAPABILITY_INTERNET is the modern way. Question 38. Which WorkManager class is used to define a one‑time background task? A) PeriodicWorkRequest B) OneTimeWorkRequest C) WorkContinuation D) WorkInfo Answer: B Explanation: OneTimeWorkRequest.Builder creates a work request that runs once when constraints are satisfied.

Exam

Explanation: @Test tells the JUnit runner to execute the annotated method as a test case. Question 42. In Espresso, which method is used to find a view with a specific text? A) onView(withId(R.id.my_view)) B) onView(withText("Hello")) C) onData(anything()) D) findViewByText("Hello") Answer: B Explanation: onView(withText("Hello")) matches a view that displays the given text. Question 43. Which ProGuard rule keeps all classes annotated with @Inject from being obfuscated? A) - keep class * { ; } B) - keep @interface androidx.inject. C) - keepclassmembers class * { @androidx.inject.Inject *; } D) - keepclassmembers class * { @javax.inject.Inject *; } Answer: D Explanation: The rule -keepclassmembers class * { @javax.inject.Inject *; } preserves members annotated with @Inject. Question 44. What is the purpose of the Android Keystore system? A) To store plain‑text passwords B) To securely generate and store cryptographic keys C) To manage SQLite databases D) To cache network responses

Exam

Answer: B Explanation: The Keystore provides hardware‑backed storage for encryption keys, making them inaccessible to the app process. Question 45. Which qualifier is used to provide a string resource for French language? A) values-fr/strings.xml B) values-fr-rFR/strings.xml C) values-fr/values.xml D) strings-fr.xml Answer: A Explanation: Placing strings.xml inside res/values-fr/ supplies French translations. Question 46. Which Android accessibility service reads aloud UI elements for visually impaired users? A) TalkBack B) VoiceOver C) Narrator D) ScreenReader Answer: A Explanation: TalkBack is Google’s screen‑reading service that provides spoken feedback. Question 47. Which layout parameter should you use to make a view fill the remaining space in a LinearLayout? A) layout_weight="1" B) layout_gravity="fill" C) layout_height="match_parent"

Exam

B) JobScheduler C) WorkManager D) BroadcastReceiver Answer: C Explanation: WorkManager guarantees execution with constraints, persisting across device reboots and app kills. Question 51. In Kotlin, what is the effect of marking a class with the sealed keyword? A) It can be subclassed only within the same file B) It prevents inheritance entirely C) It enforces a singleton pattern D) It makes the class thread‑safe Answer: A Explanation: sealed classes restrict subclassing to the same compilation unit, enabling exhaustive when expressions. Question 52. Which method of a Service is called when the system destroys the service due to low memory? A) onStop() B) onDestroy() C) onUnbind() D) onTaskRemoved() Answer: B Explanation: onDestroy() is invoked when the service is being shut down, allowing cleanup.

Exam

Question 53. Which Android XML attribute defines a view’s content description for accessibility? A) android:label B) android:contentDescription C) android:accessibilityLabel D) android:hint Answer: B Explanation: android:contentDescription provides spoken feedback for assistive technologies. Question 54. Which Gradle plugin is required to enable Kotlin annotation processing (kapt)? A) id 'kotlin-android' B) id 'kotlin-kapt' C) id 'kotlin-android-extensions' D) id 'kotlin-parcelize' Answer: B Explanation: kotlin-kapt enables Kotlin Annotation Processing Tool, used for libraries like Dagger/Hilt. Question 55. Which lifecycle state is the activity in after onPause() is called but before onStop()? A) RESUMED B) STARTED C) CREATED D) PAUSED Answer: D