Mixed Deck — All Android Development Topics Flashcards
100 cards from real Android Development practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 20 Mixed Deck — All Android Development Topics flashcards as text
Which Retrofit annotation is used to pass a dynamic value in the URL path?
Answer: @Path
@Path replaces a named placeholder in the URL template with the value of the annotated parameter at runtime.
Which Retrofit annotation is used to send a POST request body as JSON?
Answer: @Body
@Body annotation in Retrofit designates a parameter as the request body, which is serialized using the configured converter.
You'll need an AVD to make an emulator. What exactly does it mean?
Answer: Android Virtual Device
AVD stands for Android Virtual Device. It is a configuration that defines the characteristics of an Android phone, tablet, or other device that you want to simulate in the Android Emulator. An AVD specifies the Android version, hardware features, and screen size for the virtual device, allowing developers to test their apps on various configurations.
In Jetpack Compose, what happens when a State object read inside a composable changes its value?
Answer: The composable that reads it is scheduled for recomposition
Compose tracks state reads and automatically recomposes only the composables that read the changed state.
What annotation is used in Retrofit to define a GET HTTP request?
Answer: @GET
@GET annotates a Retrofit interface method to indicate it should make an HTTP GET request to the specified URL path.
Android doesn't support which of the following file formats?
Answer: AVI
Android supports a wide array of media formats for audio and video playback, including common ones like MP4, MPEG, and MIDI. However, the AVI (Audio Video Interleave) format is generally not natively supported by the Android media framework. Developers often need to use third-party libraries or convert AVI files to compatible formats for playback on Android devices.
Which attribute in RecyclerView sets the orientation for LinearLayoutManager?
Answer: app:layoutManager with orientation parameter
You configure LinearLayoutManager with HORIZONTAL or VERTICAL orientation either in code or via XML with app:layoutManager.
What is a coroutine in Kotlin?
Answer: A lightweight concurrency primitive that can suspend and resume execution
Kotlin coroutines are lightweight concurrency primitives that allow you to write asynchronous, non-blocking code in a sequential style.
Which WorkManager work type is guaranteed to run even after a device reboot?
Answer: Both A and B
WorkManager persists both OneTimeWorkRequest and PeriodicWorkRequest to a database, ensuring they survive app restarts and device reboots.
Which method is called when the size of a view changes?
Answer: onSizeChanged
onSizeChanged is called when the size of a view changes, providing the new width, height, and old values.
Which Retrofit annotation adds a static header to every request of an API method?
Answer: @Headers
@Headers annotation adds one or more static header key-value pairs to the HTTP request made by the annotated method.
What is the difference between 'minSdkVersion' and 'targetSdkVersion' in Gradle?
Answer: minSdk is the lowest OS version supported; targetSdk declares which version's behavior changes the app is tested against
minSdkVersion gates installation on old devices, while targetSdkVersion opts the app into newer platform behaviors.
Which coroutine dispatcher should be used for CPU-intensive tasks in Android?
Answer: Dispatchers.Default
Dispatchers.Default uses a shared thread pool optimized for CPU-intensive computation tasks like sorting and parsing.
Which Gradle build feature lets you produce free and paid versions of an app from one codebase?
Answer: Product flavors
Product flavors define app variants, such as free and paid, that can differ in code, resources, and application ID.
Which ConstraintLayout feature allows multiple views to be evenly spaced using a chain?
Answer: Chain style
Chains in ConstraintLayout allow you to control how a group of views distribute space and position relative to each other.
Which attribute controls the visibility of a view in Android XML?
Answer: android:visibility
The android:visibility attribute accepts VISIBLE, INVISIBLE, or GONE to control whether a view is shown or takes up space.
Which RecyclerView optimization avoids redrawing the entire list when only some items change?
Answer: Using DiffUtil (e.g. via ListAdapter) to dispatch minimal updates
DiffUtil computes the difference between old and new lists and dispatches only the necessary item-level updates.
Which Android component replaced IntentService for background processing?
Answer: Both A and B
Both WorkManager and JobIntentService replaced IntentService, with WorkManager being preferred for most deferrable background work.
Which of the three basic components of an.apk file is not one of these?
Answer: Webkit
An `.apk` (Android Package Kit) file is the package format for Android applications, containing all necessary components for installation. It typically includes the Dalvik Executable (.dex files), compiled resources (like layouts and strings), and native libraries (C/C++ code). WebKit is a browser engine that might be *used by* an app, but it's not a fundamental structural component *of* the `.apk` file itself.
Which Espresso method simulates a button click in a UI test?
Answer: perform(click())
In Espresso, perform(click()) is chained after onView() to simulate a user tapping on the matched view.