Native Android
Android apps end to end: Compose or View UI, lifecycle, Hilt or Koin injection, Room and DataStore storage, WorkManager and SDK tooling. Interviewers map the role here, then drill into one layer.
on this pageshowhide
explore
- Jetpack Compose58 questions
- Composable Functions6 questions
- State and Recomposition6 questions
- Modifiers & Custom Layouts5 questions
- Animation APIs6 questions
- Side Effects6 questions
- Material Theming5 questions
- Navigation and Lists6 questions
- Navigation 3 & NavDisplay6 questions
- AndroidView & ComposeView6 questions
- Semantics-Based UI Tests6 questions
- Jetpack Architecture Components11 questions
- ViewModel & Saved State6 questions
- Lifecycle-Aware Scopes5 questions
- RecyclerView6 questions
- LiveData6 questions
- Hilt6 questions
- Koinempty
- Room Database33 questions
- Entities and Schema6 questions
- DAOs and Queries5 questions
- Relations and Embedded6 questions
- Type Converters5 questions
- Migrations and Schema6 questions
- Coroutines and Flow5 questions
- DataStore6 questions
- Paging Library6 questions
- Retrofit34 questions
- Service Interfaces & Annotations6 questions
- Converters6 questions
- Call Adapters & Coroutines6 questions
- OkHttp & Interceptors6 questions
- HTTP Errors & Failures5 questions
- Multipart & File Uploads5 questions
- Apollo Kotlinempty
- Chuckerempty
- WorkManager6 questions
- Jetpack Benchmark6 questions
- LeakCanary7 questions
- Timberempty
- Crashlyticsempty
- Android SDK52 questions
- Activities and Fragments6 questions
- Services & System Schedulers6 questions
- Intents and IPC6 questions
- Manifest and Permissions6 questions
- Notifications & Channels6 questions
- Keystore & Biometric Keys6 questions
- Resources and Layouts5 questions
- Build Tools and Gradle6 questions
- ADB and Emulator5 questions
- Google Play Services6 questions
- Google Play Store6 questions
- Firebase Distribution6 questions
- Google AdMobempty
- Firebase Analyticsempty
- Espresso6 questions
- Media3 & ExoPlayer6 questions
questions
267 · 18 sectionsIn Compose, how do animateDpAsState and animateColorAsState animate a bouquet price badge, and what happens when the target changes mid-animation?
basics
~20 sanimateDpAsState and animateColorAsState take a target value and return a State that moves toward it each frame under a spring by default. A new target mid-flight redirects the running animation from its current value and velocity.
In Compose, how does AnimatedVisibility slide an order summary in and out, and why does a plain if-statement not animate its removal?
basics
~20 sAnimatedVisibility runs an EnterTransition when visible becomes true and an ExitTransition when it becomes false, keeping the content composed until the exit finishes. An if-statement removes the content at once, so there is nothing left to animate.
In Jetpack Compose, what does the @Composable annotation change about a function, and where may a composable be called from?
basics
~20 s@Composable changes a function's type: the Compose compiler passes an implicit composition context into it, so it can only be called from another composable function or composable lambda, never from onClick, a coroutine or an ordinary function.
In Jetpack Compose Material 3, how does MaterialTheme supply colors, typography and shapes to components, and how should a composable read them?
basics
~20 sMaterialTheme takes a ColorScheme, a Typography and a Shapes and provides them to everything in its content. Material components use them as defaults, and your own composables read MaterialTheme.colorScheme, .typography and .shapes instead of hardcoding values.
In Jetpack Compose, why does Modifier.padding(16.dp).background(Color.Red) render differently from Modifier.background(Color.Red).padding(16.dp)?
basics
~10 sEach modifier wraps everything after it. Padding then background insets first, so red fills only the inner area; background then padding paints the whole padded area red, then insets the content.
In Jetpack Lifecycle, what are the Lifecycle.State and Lifecycle.Event values, and how does each event move an owner between states?
basics
~10 sLifecycle.State has five values, DESTROYED, INITIALIZED, CREATED, STARTED and RESUMED; Lifecycle.Event has ON_CREATE through ON_DESTROY plus ON_ANY. Each event moves the owner one step: ON_PAUSE back to STARTED, ON_STOP back to CREATED.
In a Jetpack ViewModel, why does screen state survive a rotation, and when does the ViewModelStore finally clear the ViewModel?
basics
~20 sA ViewModel lives in its owner's ViewModelStore, which survives a configuration change, so the recreated Activity gets the same instance back. The store clears it, calling onCleared, only when the owner ends for good, such as a finished Activity or a popped navigation entry.
In Jetpack Lifecycle, why is launchWhenStarted deprecated in favour of repeatOnLifecycle(Lifecycle.State.STARTED), and what does each do when the screen stops?
basics
~20 slaunchWhenStarted only suspends its block on a pausing dispatcher when the screen stops, so a flow's producer keeps running and wastes resources. repeatOnLifecycle(STARTED) cancels the block on ON_STOP and relaunches it on ON_START; launchWhenX is deprecated since Lifecycle 2.6.0.
In a Jetpack ViewModel, how does SavedStateHandle keep a half-filled car-rental booking form across process death, and what are its limits?
basics
~20 sSavedStateHandle is a key-value map the ViewModel receives in its constructor; it is written into the owner's saved state when the Activity stops and restored after process death. It holds only Bundle-compatible values, and loses them when the user removes the task.
With Jetpack Lifecycle, how do you build a GPS boarding-gate checker as a DefaultLifecycleObserver, and what does a late addObserver call deliver?
basics
~10 sImplement DefaultLifecycleObserver, override onStart to begin GPS checks and onStop to end them, then call lifecycle.addObserver(checker). Added late, the observer is replayed every event up to the current state, in order.
In RecyclerView, what does onCreateViewHolder do versus onBindViewHolder, and why must every bind reset each view it sets?
basics
~20 sonCreateViewHolder inflates a row layout and caches its child views in a new ViewHolder; onBindViewHolder writes one item's data into an existing, possibly recycled holder. A recycled holder keeps the last item's state, so each bind must set every view.
With RecyclerView's ListAdapter, how do DiffUtil.ItemCallback and submitList replace notifyDataSetChanged, and why can an update silently fail to appear?
basics
~20 sListAdapter diffs each submitted list against the current one on a background thread using DiffUtil.ItemCallback, then dispatches precise insert, remove, move and change events. Resubmitting the same mutated list instance is ignored, so no update is dispatched.
In RecyclerView, how do getItemViewType and GridLayoutManager's SpanSizeLookup together make section headers span a tablet grid's full width?
basics
~10 sgetItemViewType tells the adapter which layout and ViewHolder each position uses, so headers and books get different holders. GridLayoutManager's SpanSizeLookup then returns the full span count for header positions and one span for books.
In a vertical RecyclerView with horizontal carousels nested in its rows, how do a shared RecycledViewPool and setInitialPrefetchItemCount stop the scroll hitch?
basics
~20 sEach nested RecyclerView otherwise has its own empty pool and inflates cards when its row appears. Sharing one RecycledViewPool lets carousels reuse card holders, and setInitialPrefetchItemCount makes prefetch build the visible cards before the row scrolls in.
In a RecyclerView whose rows show live download progress, why does each ListAdapter update make the row flicker, and how do change payloads fix it?
basics
~20 sWithout a payload, DefaultItemAnimator binds the change into a second ViewHolder and cross-fades the two, so each progress tick flashes the row. Returning a payload from getChangePayload lets RecyclerView reuse the same holder for a partial bind.
In LiveData, what does it mean that an observer registered with observe(this, observer) in an activity is lifecycle-aware?
basics
~10 sLiveData calls an observer registered with observe(owner, observer) only while the owner is STARTED or RESUMED, gives it the latest value when it becomes active, and removes it automatically when the owner reaches DESTROYED.
With MutableLiveData, when do you call setValue versus postValue, and what happens to values posted in quick succession?
basics
~20 ssetValue must run on the main thread and notifies active observers immediately. postValue works from any thread and schedules the update on the main thread; posts made before that task runs collapse, so only the last value arrives.
In a fragment, why observe LiveData with viewLifecycleOwner rather than the fragment itself, and when does observeForever need removeObserver?
basics
~20 sA fragment outlives its view on the back stack, so observers bound to the fragment pile up and touch dead views; viewLifecycleOwner removes them in onDestroyView. observeForever is never removed automatically, so every such observer needs its own removeObserver call.
In LiveData, how do map and switchMap differ, and when would you add distinctUntilChanged to the chain?
basics
~20 smap applies a function to each value; switchMap's function returns a LiveData, and the result follows only the latest one returned. distinctUntilChanged drops values equal to the last one, because setValue never compares and would re-run observers.
After a rotation, a LiveData-driven order-tracking screen shows its 'Order cancelled' snackbar again; why does LiveData redeliver it, and how do you fix it?
basics
~20 sLiveData keeps its last value and delivers it to every new observer once started, so the recreated activity shows the message again. Handled-flag event wrappers were the old fix; today the message is UI state the ViewModel clears once shown.
In Hilt, what do @HiltAndroidApp and @AndroidEntryPoint do, and what fails when an injected fragment's host activity lacks @AndroidEntryPoint?
basics
~20 s@HiltAndroidApp on the Application triggers Hilt's code generation and holds the app-wide SingletonComponent; @AndroidEntryPoint makes an activity, fragment, view, service or receiver injectable. A Hilt fragment inside a non-Hilt activity throws IllegalStateException when it is attached.
In a Hilt module, when do you use @Binds versus @Provides, and how does @InstallIn decide where those bindings can be injected?
basics
~20 s@Binds is an abstract method mapping an interface to an implementation Hilt can already build; @Provides has a body that constructs the instance, for third-party or builder-made types. @InstallIn names the Hilt component: bindings are visible there and in its child components.
With Hilt, how does an Android screen obtain a @HiltViewModel, and why is injecting that ViewModel into an @Inject field rejected?
basics
~20 sAnnotate the ViewModel with @HiltViewModel and an @Inject constructor, then request it through the ViewModel APIs: by viewModels() in an @AndroidEntryPoint activity or fragment, or hiltViewModel() in Compose. Field injection fails the build because it bypasses the ViewModelStore.
In Hilt, which scope fits an article cache shared by the ViewModels of one reader activity that must survive rotation, and why not @ActivityScoped or @Singleton?
basics
~20 s@ActivityRetainedScoped: ActivityRetainedComponent survives configuration changes and ends when the activity finishes, and ViewModels can see it. @ActivityScoped is rebuilt on every rotation, losing the cache; @Singleton keeps it for the whole process and shares it across every reader screen.
In Hilt, how do you inject dependencies into a WorkManager worker and into a ContentProvider, two classes Hilt does not instantiate?
basics
~20 sA worker gets @HiltWorker and an @AssistedInject constructor with @Assisted Context and WorkerParameters, and WorkManager is configured with the injected HiltWorkerFactory. A ContentProvider declares an @EntryPoint interface installed in SingletonComponent and reads it through EntryPointAccessors.fromApplication().
In Room, what does declaring a DAO function suspend change, and on which thread does its query run when called from the main thread?
basics
~10 sA suspend DAO function is main-safe: Room moves the query to its own coroutine context (Dispatchers.IO by default in Room 3.0, the query executor in Room 2.x) and resumes the caller with the result.
In Room, how do @Insert, @Update, @Delete and @Query DAO functions differ, and what can each one return?
basics
~20 s@Insert, @Update and @Delete take entity objects and Room writes the SQL, matching rows by primary key; @Query runs SQL you write. Inserts can return the new rowid as Long, updates and deletes an Int row count.
In Room, what does annotating a Kotlin data class with @Entity declare, and how does @Database tie the entities together?
basics
~20 s@Entity declares a SQLite table: one table per class, one column per persisted property, keyed by its @PrimaryKey. @Database lists those entity classes with a schema version, and Room's compiler generates the database that creates and checks the tables.
In Room 3.0, how do you store an Instant property on an entity, and where do you register the converter that makes it work?
basics
~10 sRoom 3.0 stores an Instant through two @ColumnTypeConverter functions, Instant to Long epoch millis and back, registered with @ColumnTypeConverters on the @Database class so every entity and DAO can use them.
In Room, how does a DAO query returning Flow re-emit when a background sync inserts new messages, and why can it re-emit unchanged results?
basics
~20 sRoom tracks the tables a Flow query reads; after any write to one of them, it re-runs the whole query and emits the new result, even when the write touched rows outside it, so equal lists can arrive.
In Preferences DataStore, how do you create the store, define typed keys, and read and write a reading app's theme and font size?
basics
~10 sDeclare one top-level preferencesDataStore delegate, define keys with stringPreferencesKey or intPreferencesKey, read by mapping the data Flow (a missing key gives null), and write inside the suspending edit block on MutablePreferences.
When would you choose a typed DataStore with a Serializer over Preferences DataStore, and how do updateData and data.first() behave there?
basics
~20 sChoose typed DataStore when the data is a structured object that needs a schema and type safety. Its Serializer supplies defaultValue, readFrom and writeTo; updateData runs a serialized, atomic transform on an immutable value; data.first() takes one snapshot.
In Jetpack DataStore, why does a second instance on the same file throw IllegalStateException, and how do you share one file across processes?
basics
~20 sDataStore allows one active instance per file in a process; a second one fails on its first read or write with "There are multiple DataStores active for the same file". Across processes, every process must use MultiProcessDataStoreFactory, one instance each.
As the Android lead moving a shipped app from SharedPreferences to DataStore, how would you plan the migration and choose Preferences or typed DataStore as the team default?
basics
~20 sRegister a SharedPreferencesMigration in produceMigrations, keep key names and types identical, switch every reader in the same release because cleanUp deletes the old keys, and plan for rollback. Default to Preferences DataStore for flat settings, typed DataStore for structured objects.
In Paging 3, what do a PagingSource and a Pager each do, and what can PagingSource.load() return?
basics
~20 sA PagingSource loads one page per load() call and returns LoadResult.Page, LoadResult.Error for a recoverable failure, or LoadResult.Invalid when its data changed. A Pager combines a PagingConfig with a PagingSource factory and exposes the loads as a Flow<PagingData>.
In Paging 3, why does a ViewModel end its Pager.flow chain with cachedIn(viewModelScope), and where do map and insertSeparators go relative to it?
basics
~20 scachedIn(viewModelScope) shares the PagingData stream and keeps its loaded pages alive in the ViewModel, so a rotated screen gets them back instead of reloading. Put map, filter and insertSeparators before it so their results are cached too.
In Paging 3, what does PagingSource.getRefreshKey() decide, and how do you implement it for a page-numbered wine catalogue API?
basics
~20 sgetRefreshKey() picks the key a new generation's first load starts from after an invalidation, so the list reloads where the user is. For page numbers, take the page closest to state.anchorPosition and return prevKey + 1 or nextKey - 1.
In Paging 3, how does a RemoteMediator fill a Room cache for an offline wine catalogue, and how do newly fetched wines reach the list?
basics
~20 sThe Pager reads only from Room's PagingSource; when it reaches an end or a refresh is requested, Paging calls RemoteMediator.load(), which fetches a page and writes it to the database. That write invalidates the PagingSource, so a new generation shows the wines.
In Retrofit 3, what may a suspend service method return, and why does Retrofit reject one declared to return Call<T>?
basics
~10 sA Retrofit 3 suspend method returns the body type T, Response<T> when status and headers matter, or Unit to discard the body. Call<T> is rejected because a suspend method already runs its call asynchronously.
In Retrofit 3, what does a converter factory do, and what happens if a service method returns a data class with none registered?
basics
~20 sA Retrofit converter factory turns a successful response body into the declared type and a @Body value into a request body. With none added, only ResponseBody, RequestBody, Unit and Void work; a data class fails with "Unable to create converter".
With Retrofit, what happens on an HTTP 404 when a suspend service method returns User instead of Response<User>?
basics
~20 sReturning User, the suspend method throws HttpException on a 404, since it can only hand back a body. Returning Response<User>, it returns normally and you check isSuccessful, code() and errorBody(); a network failure throws either way.
In Retrofit, how do you declare a service method that uploads a profile photo file together with a text caption?
basics
~10 sAnnotate the method with @Multipart and a body-carrying verb such as @POST, pass the photo as @Part MultipartBody.Part built by createFormData with a filename, and pass the caption as @Part("caption") RequestBody.
Why does Retrofit.Builder reject a baseUrl such as https://tracker.example.com/api/v2, and how do endpoint paths resolve against a base URL?
basics
~20 sA baseUrl with a path must end in a slash, or relative endpoints would replace its last segment; Retrofit.Builder throws IllegalArgumentException otherwise. Endpoints resolve like web links: relative paths append, a leading slash keeps only the host, a full URL replaces it.
In WorkManager, how do you schedule a photo upload that runs only on unmetered Wi-Fi while charging, and why not just launch a coroutine?
basics
~10 sSubclass CoroutineWorker, build a OneTimeWorkRequest whose Constraints require NetworkType.UNMETERED and charging, and enqueue it. WorkManager persists the request, so it survives process death and reboot; a plain coroutine dies with the process.
In WorkManager, how do you run compress-then-upload as one unique chain, pass Data between the steps, and observe it from the UI?
basics
~10 sCall beginUniqueWork(name, ExistingWorkPolicy, compress).then(upload).enqueue(); each step's output Data, at most 10 KB, becomes the next step's input. Observe the chain with getWorkInfosForUniqueWorkFlow(name), which emits every step's WorkInfo.
In WorkManager, when the user taps Back up now on a large album, when do you use setExpedited with an OutOfQuotaPolicy, and when setForeground with ForegroundInfo?
basics
~20 ssetExpedited suits short, user-important work that must start now; it uses a system quota and allows only network and storage constraints. setForeground runs a worker as a foreground service with a notification, for user-visible work that may exceed ten minutes.
In WorkManager, a nightly cleanup runs as unique periodic work; how do the 15-minute floor, the flex interval and ExistingPeriodicWorkPolicy decide when it runs and which version runs?
basics
~20 sPeriodicWorkRequest clamps intervals under 15 minutes to 15 with a log warning, and a flexInterval of at least 5 minutes confines runs to the end of each period. ExistingPeriodicWorkPolicy.UPDATE applies a new spec without resetting the schedule; KEEP keeps the old one.
In WorkManager without Hilt, how do you give a worker constructor dependencies through a custom WorkerFactory, and how do you test that worker?
basics
~10 sSubclass WorkerFactory, build your worker in createWorker (return null to fall back to the default), set it with Configuration.Builder.setWorkerFactory from an Application implementing Configuration.Provider, and remove WorkManagerInitializer from the manifest. Test with TestListenableWorkerBuilder.setWorkerFactory.
In Jetpack Benchmark, how does a Microbenchmark with BenchmarkRule differ from a Macrobenchmark with MacrobenchmarkRule, and why run them on a physical device?
basics
~20 sA Microbenchmark loops one hot function inside the test process with BenchmarkRule; a Macrobenchmark drives the installed app from a separate test module to time startup or frames. Emulators measure the host, so both report an error.
In Jetpack Macrobenchmark, how do CompilationMode.None, Partial and Full differ, and which mode does measureRepeated use when you pass none?
basics
~20 sNone resets compilation so code runs JIT-only, the worst case; Partial pre-compiles with the Baseline Profile or warmup runs, like a store install; Full compiles everything ahead of time. The default is Partial with BaselineProfileMode.UseIfAvailable on API 24+.
In a Jetpack Macrobenchmark, how do StartupMode.COLD, WARM and HOT change each iteration, and what do StartupTimingMetric's two values measure?
basics
~20 sCOLD kills the process before every measured launch, WARM keeps the process but recreates the activity, HOT brings the existing activity forward. StartupTimingMetric reports timeToInitialDisplayMs to the first frame and timeToFullDisplayMs to the app's fully-drawn signal.
After a dependency upgrade slowed cold start, how do you generate a Baseline Profile with BaselineProfileRule and the androidx.baselineprofile plugin, then verify it helped?
basics
~10 sRecord startup with BaselineProfileRule.collect in a com.android.test module, let the androidx.baselineprofile plugin copy the rules into the app's source set, ship ProfileInstaller, then compare a cold-start Macrobenchmark under CompilationMode.None() and Partial(BaselineProfileMode.Require).
A news feed janks on scroll; how would you write a Jetpack Macrobenchmark with FrameTimingMetric and TraceSectionMetric to prove a fix, and how do you read its results?
basics
~20 sScroll the feed in a Macrobenchmark's measureBlock with FrameTimingMetric and a TraceSectionMetric around the row code. Compare P90 to P99 frameOverrunMs, where positive values are dropped frames, plus the section's count and total, before and after.
How do you add LeakCanary 2 to an Android app, and why does it go in debugImplementation with no setup code?
basics
~10 sAdd com.squareup.leakcanary:leakcanary-android:2.14 as a debugImplementation dependency and write no code: a ContentProvider merged from the library installs it at startup, and keeping it debug-only matters because it refuses to run in a non-debuggable build.
After rotating a screen several times, LeakCanary reports a leaked activity; how do you read its leak trace to find the reference to fix?
basics
~20 sRead the leak trace from the GC root down to the destroyed activity. Objects are marked Leaking: NO, UNKNOWN or YES; the underlined suspects lie between the last NO and the first YES, and the one never cleared is the bug.
What does LeakCanary 2 watch automatically, when does a watched object count as retained, and when does it dump the heap?
basics
~20 sLeakCanary 2 watches destroyed activities, fragments, fragment views and services, cleared ViewModels and detached root views. One still reachable 5 seconds later, after a GC, is retained; it dumps the heap at 5 retained while visible, 1 in the background.
How does LeakCanary tell a Library Leak from an Application Leak, and what do you do when a third-party SDK keeps leaking your activity?
basics
~20 sLeakCanary matches each trace against known leak patterns, AndroidReferenceMatchers by default; a leak whose only path runs through a matched reference is a Library Leak. For a leaking SDK, report it upstream and add your own matcher meanwhile.
With LeakCanary, how do you make Android instrumentation tests fail on memory leaks, and why does the rule's position in a RuleChain matter?
basics
~20 sAdd leakcanary-android-instrumentation as an androidTestImplementation dependency and use the DetectLeaksAfterTestSuccess rule or call LeakAssertions.assertNoLeaks(). Placed outside the activity rule it catches activity leaks; inside, it catches fragment leaks that vanish once the activity is destroyed.
In an Android Activity, which lifecycle callbacks run, and in what order, when the user rotates the device, presses Home, and presses Back?
basics
~20 sRotation destroys and recreates an Activity: onPause, onStop, onDestroy, then onCreate, onStart, onResume on a new instance. Home runs onPause and onStop and keeps it. Back adds onDestroy, except on a root launcher activity on Android 12+.
With adb, how do you get logs off a misbehaving Android device and narrow logcat to your own tags and priorities?
basics
~20 sList devices with adb devices, target one with -s, then run adb logcat with tag:priority filters ending in *:S so only your tags print; read the crash buffer for stack traces and take adb bugreport for a full capture.
In an Android app module's build file, what do compileSdk, minSdk and targetSdk each control, and how do they relate?
basics
~10 scompileSdk sets which Android APIs your code compiles against, minSdk sets the oldest Android version that can install the app, and targetSdk declares which version's runtime behaviour the app was tested for.
On Android, what is the difference between an explicit and an implicit intent, and how does the system resolve an implicit one?
basics
~20 sAn explicit intent names the component to start, so Android delivers it there directly; an implicit intent describes an action, data and categories, and Android matches it against installed apps' intent filters, letting the user pick when several match.
In the Android Keystore, where should the key that encrypts a session token live now that EncryptedSharedPreferences is deprecated, and what does the app hold?
basics
~20 sGenerate the key inside the AndroidKeyStore provider, which security-crypto 1.1.0 points to after deprecating EncryptedSharedPreferences. The app holds only a SecretKey handle: the Keystore performs each encryption outside the app's process and never exports the key material.
What is Google Play services on an Android device, and why should an app check it with GoogleApiAvailability before calling its APIs?
basics
~20 sGoogle Play services is a Google app on certified Android devices that runs the implementation behind thin client libraries for location, Maps and sign-in. Devices without the Play Store lack it, so apps check isGooglePlayServicesAvailable and offer a fix or fallback.
With Google Play services' FusedLocationProviderClient, when do you use getCurrentLocation instead of requestLocationUpdates, and what does a LocationRequest's Priority change?
basics
~20 sUse getCurrentLocation for one fresh fix and requestLocationUpdates only for a continuous stream, which you must stop with removeLocationUpdates. The LocationRequest's Priority tells the fused provider how much accuracy to trade for battery, from PRIORITY_HIGH_ACCURACY down to PRIORITY_PASSIVE.
In the Play In-App Update library, how do flexible and immediate updates differ, and how do updatePriority and clientVersionStalenessDays help you choose between them?
basics
~20 sA flexible update downloads in the background while the user keeps working, and the app calls completeUpdate to install it. An immediate update blocks the app until Play installs and restarts it. updatePriority (0-5) and clientVersionStalenessDays decide which to request.
With Credential Manager on Android, how do you implement Sign in with Google, and what should the app do when getCredential throws NoCredentialException?
basics
~20 sWrap a GetGoogleIdOption in a GetCredentialRequest, call CredentialManager.getCredential, turn the returned CustomCredential into a GoogleIdTokenCredential and send its idToken to the server to verify. On NoCredentialException, retry without authorized-account filtering to offer sign-up, then fall back to regular sign-in.
With the Play Integrity API, how does a standard request differ from a classic one, and how do requestHash and nonce bind a verdict to one action?
basics
~20 sA standard request warms up a token provider once, then returns tokens in a few hundred milliseconds, replay-protected by Google Play. A classic request recomputes everything and relies on your nonce. requestHash or nonce carries a request digest the server recomputes.
In Google Play Console, what are the internal, closed, open and production tracks, and who can install a build from each?
basics
~20 sPlay Console has four tracks: internal testing (up to 100 listed testers), closed testing (testers invited by email list, Google Group or organization), open testing (any Google Play user can join) and production (all Google Play users in your chosen countries).
With Play App Signing, how do the upload key and the app signing key differ, and why does an Android App Bundle need it?
basics
~20 sYou sign the bundle with an upload key proving it is yours; Google Play holds the app signing key and signs the per-device APKs it generates. A bundle defers APK generation and signing to Play, so Play must hold that key.
In Play Console, how do you run, raise, halt and resume a staged rollout of an app update, and what does each step do to users?
basics
~20 sA staged rollout serves an update to a random share of users that you raise by hand. Halting stops new users getting it while those who updated keep it; resuming reaches the same users, and fixes ship as new releases.
On Google Play, a fintech update targets API 35 and its Data safety form omits an analytics SDK's data; what does each rule require as of October 2026?
basics
~20 sFrom August 31, 2026, phone app updates must target Android 16 (API 36) to be submitted. The Data safety form must declare all user data the app collects or shares, including data its third-party SDKs send off the device.
As an Android lead, how would you structure your team's Play Console tracks and promotion rules: who gets which build, and what moves a release up?
basics
~20 sGive each track an audience and an exit rule: builds to internal testing, candidates to closed testing, open testing only if a public beta fits, then staged production. Promote the same bundle only on agreed signals like vitals and hold times.
What is Firebase App Distribution for, and how does an invited tester get a pre-release Android build onto a device?
basics
~20 sFirebase App Distribution gets pre-release Android and iOS builds to named testers. You upload a build, choose testers or groups, add release notes and Distribute; testers accept the emailed invitation with a Google Account and install from the App Tester app.
In Firebase App Distribution, how does CI upload a nightly Android build to tester groups with release notes, via the CLI or Gradle plugin?
basics
~10 sCI runs firebase appdistribution:distribute with --app, --groups and --release-notes-file, or the Gradle plugin's appDistributionUploadRelease task configured in a firebaseAppDistribution block, both authenticated with a service account holding the Firebase App Distribution Admin role.
Uploading an Android App Bundle to Firebase App Distribution fails with 'This project is not linked to a Google Play account'; what must be in place, and what changes for testers?
basics
~20 sAAB releases go through Google Play's internal app sharing, so the Firebase project must be linked to a Play account holding the same package, published on a track. Play re-signs the APKs with a test certificate, and testers turn on internal app sharing.
In Firebase App Distribution, an iOS tester accepted the invite but cannot install your ad hoc build; what is missing and how do you fix it?
basics
~20 sThe device's UDID is not in the ad hoc provisioning profile. Export the registered UDIDs from App Distribution, add the devices in the Apple developer account and to the profile, rebuild with the same version and build number, and redistribute.
As a lead, would you make Firebase App Distribution or Play's internal testing track the team default for Android pre-release builds, and why?
basics
~20 sUsually App Distribution for day-to-day builds and Play's internal testing track for release candidates. App Distribution takes any signed variant on both platforms for up to 500 testers; the internal track delivers the store-signed bundle through Google Play to at most 100.
In Espresso, what do onView, perform and check each do, and what happens when the matcher finds no view or several views?
basics
~10 sonView takes a ViewMatcher that must match exactly one view, perform runs ViewActions such as click() on it, and check applies a ViewAssertion such as matches(isDisplayed()). No match throws NoMatchingViewException; several matches throw AmbiguousViewMatcherException.
Before each Espresso action or assertion, what does Espresso wait for on its own, what work can it not see, and why turn animations off?
basics
~20 sEspresso waits until the main message queue has nothing due, no AsyncTask runs and all registered idling resources are idle. Your own threads, executors and coroutine dispatchers are invisible to it; animations go off because they cause flakiness.
An Espresso login test passes locally but flakes on CI while the sign-in network call completes; how do you fix it with an IdlingResource?
basics
~20 sThe sign-in call runs off the main thread, so Espresso asserts before the response arrives. Wrap the call in a CountingIdlingResource (increment before, decrement in finally), register it with IdlingRegistry in @Before and unregister it in @After.
In Espresso, when do you use onData instead of onView, and how do you click an off-screen RecyclerView row with RecyclerViewActions?
basics
~20 sUse onData for AdapterView lists such as ListView, GridView and Spinner: it matches the adapter's data object and loads that row before acting. RecyclerView is not an AdapterView, so you call onView on the RecyclerView and perform a RecyclerViewActions action from espresso-contrib.
As Android lead, how large a share of UI tests should be Espresso tests, and do you standardise on idling resources or injected idling-aware dispatchers for synchronisation?
basics
~20 sKeep Espresso for flows that need a real View hierarchy on a device and pin everything else lower. For synchronisation, pick one team standard: injected idling-aware executors cover most background work automatically, CountingIdlingResource covers the rest explicitly, and sleeps are banned.
With Media3's ExoPlayer, how do you play a lesson's HLS video in a PlayerView, and when and why must you release the player?
basics
~20 sBuild an ExoPlayer with ExoPlayer.Builder, set it on a PlayerView, give it a MediaItem for the .m3u8 URI (needs the HLS module), then prepare() and play(). Release it when the screen stops: it holds decoders other apps need.
In Media3, how do MediaSession and MediaSessionService keep a lesson's audio playing with the screen off and give the learner system playback controls?
basics
~20 sMove the ExoPlayer into a MediaSessionService subclass, wrap it in a MediaSession returned from onGetSession, and declare the service with foregroundServiceType mediaPlayback. Media3 runs it in the foreground with a media notification while playing; screens control it through a MediaController.
In Media3, how does a Player.Listener follow a lesson playlist through buffering, ready, ended and item changes, and how should it handle a PlaybackException?
basics
~10 sA Player.Listener gets onPlaybackStateChanged (IDLE, BUFFERING, READY, ENDED), onIsPlayingChanged and onMediaItemTransition with a reason. Errors arrive in onPlayerError as a PlaybackException with an errorCode, just before STATE_IDLE; recover by calling prepare() again.
In Media3's ExoPlayer, how do you make lessons prefer the learner's chosen audio language and cap video at SD with TrackSelectionParameters?
basics
~10 sCopy the player's TrackSelectionParameters with buildUpon(), call setPreferredAudioLanguage("es") and setMaxVideoSizeSd(), and assign the result back. These are constraints, so they work before prepare() and apply to every lesson in the playlist.
In Media3, a learner downloads a course for a flight; how do DownloadManager, DownloadService and SimpleCache fit together, and why does a second SimpleCache on that folder crash?
basics
~20 sDownloadService wraps a DownloadManager that writes segments into a SimpleCache and records state in a DownloadIndex; playback reads that cache through a CacheDataSource.Factory. SimpleCache locks its folder, so a second instance throws IllegalStateException; keep one per process.