tezvyn:

📱Mobile Dev

Mobile app development across platforms

1323 bites

More in Mobile Dev — page 35

Explain Recomposition in Jetpack Compose
Android & Kotlin2 min read

Explain Recomposition in Jetpack Compose

Tests your grasp of Compose's declarative model. A good answer defines recomposition, explains state-read triggers, and details how stability and positional memoization enable skipping. A red flag is assuming any state change redraws the entire UI.

How to arrange UI elements in Jetpack Compose?
Android & Kotlin2 min read

How to arrange UI elements in Jetpack Compose?

This tests your grasp of Compose's declarative layout basics. A good answer defines Column (vertical) and Row (horizontal) for structure, and Modifier for decoration, size, and behavior. A red flag is confusing Modifiers with simple styling.

What is the purpose of the `remember` function in Compose?
Android & Kotlin2 min read

What is the purpose of the `remember` function in Compose?

This tests your grasp of recomposition. Explain that `remember` stores an object in the composition tree, preventing it from being re-initialized on every render. A red flag is confusing it with `rememberSaveable`, which survives configuration changes.

Android & Kotlin2 min read

How does ConstraintLayout enable complex, responsive UIs?

Tests your grasp of modern Android UI performance and responsiveness. Explain how relative positioning flattens hierarchies, then define chains for distributing space and barriers for handling dynamic content size.

Styles vs. Themes and Attribute Resolution in Android
Android & Kotlin2 min read

Styles vs. Themes and Attribute Resolution in Android

This tests your grasp of Android's resource indirection. A Style is a set of attributes for one View type. A Theme is a collection of named attributes for an app or Activity. `?attr` is resolved at runtime against the Theme, while `@color` is a direct.

LinearLayout vs. RelativeLayout vs. FrameLayout: Explain and give use cases
Android & Kotlin2 min read

LinearLayout vs. RelativeLayout vs. FrameLayout: Explain and give use cases

Tests your grasp of classic Android layouts and performance trade-offs. A good answer defines each, gives a clear use case, and mentions `layout_weight`. A red flag is proposing nested `LinearLayout`s for complex UIs, ignoring performance.

Android & Kotlin2 min read

How does Android manage a ContentProvider's lifecycle during a query?

This tests your understanding of Android IPC and component lifecycles. Explain how ContentResolver uses a URI to have the system instantiate the provider in its own process.

Bound Service Lifecycle: Config Changes and Multiple Clients
Android & Kotlin2 min read

Bound Service Lifecycle: Config Changes and Multiple Clients

Tests deep knowledge of bound service lifecycles. A config change causes an unbind/rebind cycle, recreating the service. With multiple clients, the service isn't destroyed until the last one unbinds. Red flag: assuming the service survives the config change.

Handle Android Process Death vs. Configuration Changes
Android & Kotlin2 min read

Handle Android Process Death vs. Configuration Changes

Tests your grasp of Android's lifecycle for state restoration. A good answer explains that `onCreate(savedInstanceState)` is called in both cases, but process death recreates everything. Use `ViewModel` with `SavedStateHandle`.

Static vs. Dynamic BroadcastReceivers: Implications and Restrictions
Android & Kotlin2 min read

Static vs. Dynamic BroadcastReceivers: Implications and Restrictions

This tests your knowledge of Android's background execution limits. A good answer defines static and dynamic registration, explains the restrictions since Android 7/8, and gives use cases. A red flag is ignoring the modern API limitations.

When and why use a Foreground Service on modern Android?
Android & Kotlin2 min read

When and why use a Foreground Service on modern Android?

Tests understanding of background work restrictions. A great answer defines the use case for user-visible tasks, explains the mandatory notification, and details the `startForegroundService()` flow.

singleTask Launch Mode: A -> B -> C Back Stack
Android & Kotlin2 min read

singleTask Launch Mode: A -> B -> C Back Stack

This tests your understanding of Android's `singleTask` launch mode and task management. A good answer explains that A and B form a stack in one task, while C launches into a new, separate task, becoming its root.

How does a ViewModel survive configuration changes?
Android & Kotlin2 min read

How does a ViewModel survive configuration changes?

Tests understanding of ViewModel's scope, separate from the Activity lifecycle. A ViewModel is retained by a ViewModelStore, which persists across configuration changes. The new Activity instance then reconnects to the same ViewModel.

Started vs. Bound Services: Differences and Use Cases
Android & Kotlin2 min read

Started vs. Bound Services: Differences and Use Cases

Tests your grasp of Android component lifecycles. A strong answer defines each by its lifecycle control (who starts/stops it) and communication pattern (fire-and-forget vs. client-server), then gives distinct use cases.

How do you save UI state during screen rotation?
Android & Kotlin2 min read

How do you save UI state during screen rotation?

Tests your grasp of the Activity lifecycle and state restoration. A great answer explains the destroy/recreate cycle, notes that EditText handles its own state via its ID, and contrasts the modern ViewModel + SavedStateHandle with the older…

Describe the Android Activity lifecycle when navigating away and back
Android & Kotlin2 min read

Describe the Android Activity lifecycle when navigating away and back

Tests understanding of resource management via lifecycle callbacks. A good answer traces onPause -> onStop -> onRestart -> onStart -> onResume, explaining what work happens in each.

Android & Kotlin2 min read

How would you manage API keys in Gradle without version control?

Tests secure credential handling in Android builds. A good answer proposes the Secrets Gradle Plugin, which reads from an untracked properties file and exposes keys via BuildConfig, while also noting this doesn't protect against APK decompilation.

How do you diagnose a memory leak with Android Studio Profiler?
Android & Kotlin2 min read

How do you diagnose a memory leak with Android Studio Profiler?

This tests your systematic process for debugging memory issues. A good answer outlines using the Memory Profiler, forcing GC, capturing heap dumps, and analyzing object references. A red flag is just naming the tool without explaining the 'how'.

Gradle Build Types vs. Product Flavors
Android & Kotlin2 min read

Gradle Build Types vs. Product Flavors

This tests your understanding of Gradle's build matrix for creating different app versions. A great answer defines build types (how it's built) vs. flavors (what is built) and explains that variants are the cross-product. A red flag is confusing their roles.

What is the Android Debug Bridge (ADB)?
Android & Kotlin2 min read

What is the Android Debug Bridge (ADB)?

This tests practical command-line proficiency and understanding of the host-device link. A good answer defines the client-server-daemon architecture and gives two commands like `adb install` and `adb logcat`.