skip to content

Android SDK

The Android framework beneath any UI toolkit: app components and their lifecycles, intents, the manifest and permissions, resources, the app build and adb. Interviewers treat it as the base layer.

on this pageshow

explore

questions

page 2 of 2

With NotificationCompat, how do you build and keep updating the ongoing notification a foreground service shows while a wash cycle runs?

level: middleimportance: should knowfreq 40%

basics

~20 s

Post it on its own low-importance channel, mark it setOngoing(true) and setOnlyAlertOnce(true), pass it to startForeground under a non-zero ID, and update it by calling notify with that same ID; the 'done' alert goes on a separate, louder channel.

open as a page

With NotificationCompat, how do a notification's tap intent and a 'Restart cycle' action button differ, and how do you wire each one?

level: middleimportance: should knowfreq 55%

basics

~20 s

The tap intent, set with setContentIntent, opens the matching screen with a proper back stack; an action button, added with addAction, fires its own PendingIntent, often a broadcast that restarts the cycle without opening the app.

open as a page

In Android's View system, how does a style differ from a theme, and why do DayNight layouts reference colours through ?attr/ rather than @color/?

level: middleimportance: should knowfreq 52%

basics

~20 s

A style sets attributes on the one view it is applied to; a theme names resources for a whole app, activity or view subtree. ?attr/ references resolve against the current theme, so DayNight can swap them.

open as a page

In an Android photo editor, why does committing a FragmentTransaction when a filter render finishes after the user pressed Home crash with IllegalStateException, and how do you fix it?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Once the host has run onSaveInstanceState, the FragmentManager's state is captured, so commit() throws IllegalStateException rather than make a change that would vanish on restore. Hold the result as state and commit only while the UI is at least STARTED.

open as a page

A tester's Android phone freezes right after login in your app; which adb and dumpsys commands capture and explain what happened?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Capture with adb bugreport, which includes ANR traces, or am monitor while it happens. Then read dumpsys meminfo for leaked Activities, gfxinfo for slow frames and input for stalled dispatch; on Android 17, check whether the memory limiter killed the app.

open as a page

In a CI job that boots Android emulators headless, how do you create the AVD, start it, and make each test run begin from a clean state?

level: seniorimportance: should knowfreq 25%

basics

~20 s

Install the system image, create the AVD with avdmanager create avd -k, start it with emulator -no-window plus -no-snapshot or -wipe-data, and wait for boot completion rather than adb's device state before installing. Give parallel emulators distinct even console ports.

open as a page

In an Android app, the paid flavor's release build crashes at startup with a ClassNotFoundException debug builds never show; how do you diagnose and fix it?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Only the release build runs R8, which removed or renamed a class the app loads by name. Retrace with that build's mapping.txt, then keep those classes with a narrow rule or @Keep, or reference them directly.

open as a page

How do you guard a content provider shared with your own companion app using a custom Android permission, and why choose the signature protection level?

level: seniorimportance: should knowfreq 35%

basics

~20 s

Define a <permission> with protectionLevel signature in the app that owns the provider, name it in the provider's readPermission or permission attribute, and declare it with <uses-permission> in the companion. Signature grants it silently, only to apps signed with your certificate.

open as a page

After adding an SDK, your Android release's merged manifest declares READ_PHONE_STATE that your code never uses; how do you find its source and remove it?

level: seniorimportance: should knowfreq 45%

basics

~20 s

The build merges library manifests into yours, so check the Merged Manifest view or the manifest-merger report to see which library contributed READ_PHONE_STATE. Then add a <uses-permission> for it with tools:node="remove" to the app manifest, and test the SDK without it.

open as a page

After release, an Android app raises its 'machine_done' NotificationChannel from IMPORTANCE_DEFAULT to IMPORTANCE_HIGH in code, yet existing users get no heads-up alerts; why, and what do you do?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Once a channel exists the user owns its behaviour: re-registering it can only lower its importance, never raise it. For heads-up alerts, create a new channel ID at IMPORTANCE_HIGH and delete the old one, or link users to its settings.

open as a page

In an Android app, a NotificationCompat direct-reply action shows its text field, but RemoteInput.getResultsFromIntent returns null in the receiver; why, and how do you fix it?

level: seniorimportance: should knowfreq 35%

basics

~20 s

The reply action's PendingIntent was created with FLAG_IMMUTABLE, so the system cannot add the typed text to the intent it sends. Create that one PendingIntent with FLAG_MUTABLE on an explicit intent, and re-post the notification after handling the reply.

open as a page

An Android news article screen built from deeply nested LinearLayouts with layout_weight is slow to lay out; how do the View measure and layout passes explain it, and what would you change?

level: seniorimportance: should knowfreq 44%

basics

~20 s

Views are measured, then laid out, top-down before drawing. A weighted LinearLayout may measure its children twice, and nesting compounds that work. Flattening the screen into one ConstraintLayout with 0dp constraints and weighted chains cuts that repeated work.

open as a page

On Android 15, why does a dash-cam app's dataSync foreground service uploading a day of clips crash with 'did not stop within its timeout', and how do you rebuild the upload?

level: seniorimportance: should knowfreq 42%

basics

~20 s

Apps targeting Android 15 (API 35) get six hours of dataSync foreground service per 24 hours; then onTimeout(int, int) runs and the service must stop within seconds or the app crashes. Handle onTimeout and move bulk uploads to a JobScheduler job.

open as a page

A dash-cam app schedules a planned trip's recording with AlarmManager.setExact, but it fires late while the phone sits parked in Doze; why, and what do you change?

level: seniorimportance: should knowfreq 40%

basics

~10 s

Doze defers standard AlarmManager alarms, setExact() included, to its next maintenance window. Schedule with setExactAndAllowWhileIdle(), hold SCHEDULE_EXACT_ALARM, check canScheduleExactAlarms() first, and fall back to setAndAllowWhileIdle() when the user has not granted exact alarms.

open as a page

As the Android lead of a photo editor, would you build it as one activity hosting every screen or as several activities, and what decides it?

level: principalimportance: should knowfreq 40%

basics

~20 s

Default to a single activity: screens become fragments or composables in one task, sharing state without launch modes. Add an activity only where the platform works per activity, such as a separate task in Recents or a different window setup.

open as a page

As the lead of an Android app still on minSdk 21, how do you decide whether to raise it, and what does raising it cost and unlock?

level: principalimportance: should knowfreq 36%

basics

~20 s

Raise minSdk when the users you would stop updating are worth less than the cost of carrying them: Jetpack libraries now require API 23 or 24, and every old level adds version checks, compatibility code and test devices.

open as a page

As an Android lead, how do you decide what your app exports to other apps, and how do you guard each exported activity, receiver, provider and bound service?

level: principalimportance: should knowfreq 30%

basics

~20 s

Export only what another app must start: the launcher activity, link handlers, receivers that must hear other apps. Mark everything else android:exported="false", prefer PendingIntents and URI grants to exporting, and guard the rest with permissions, caller checks and input validation.

open as a page

As Android lead on a time-clock app, should the Keystore key that encrypts the session token require user authentication, and with which setUserAuthenticationParameters mode?

level: principalimportance: should knowfreq 35%

basics

~20 s

It depends on whether code needs the token while the worker is away. No authentication keeps background refresh working; a per-use biometric key ties each clock-in to a fingerprint but, by default, dies on new enrolment; a timed key sits between them.

open as a page

As the lead of an Android social app, what permission policy do you set, and when do you replace a runtime permission with a permissionless system API?

level: principalimportance: should knowfreq 40%

basics

~20 s

Declare the fewest permissions each feature needs: the photo picker instead of media access, the system camera intent instead of CAMERA, coarse over precise location. Ask in context, degrade on denial, review what SDKs add and give back unused grants.

open as a page

Why does the Android Emulator crawl or refuse to start on some machines, and which VM acceleration does it need on each OS?

level: middleimportance: nice to knowfreq 22%

basics

~20 s

The Android Emulator needs a hypervisor and a system image matching the host CPU: KVM on Linux, Hypervisor.Framework on macOS, Windows Hypervisor Platform on Windows. Without them it crawls or will not start; emulator -accel-check shows which.

open as a page

In the Android Keystore, how does a time-clock app prefer a StrongBox-backed key and obtain a key attestation chain at enrollment, and what fails on phones without StrongBox?

level: seniorimportance: nice to knowfreq 30%

basics

~20 s

Check FEATURE_STRONGBOX_KEYSTORE, call setIsStrongBoxBacked(true), and if generation throws StrongBoxUnavailableException, generate again without it. For attestation, set the server's challenge with setAttestationChallenge on an EC or RSA key pair and send KeyStore.getCertificateChain(alias); AES keys have no certificate.

open as a page

showing 31–52 of 52