Skip to content
tezvyn:

Android & Kotlin

Jetpack Compose, Android Studio, Kotlin, Material You

157 bites

Test yourself: Top 30 Android & Kotlin concepts questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Concepts in Android & Kotlin, page 6

Expedited Work: High-Priority Background Tasks in Android
advanced2 min read

Expedited Work: High-Priority Background Tasks in Android

Expedited work is for important, short tasks that must run quickly. It gets higher priority than regular background work without requiring a persistent notification. Use it for sending messages or saving notes.

advanced2 min read

JobScheduler: Efficient, Deferrable Background Tasks

Think of JobScheduler as Android's smart alarm for tasks. You specify conditions like 'Wi-Fi only' or 'charging,' and the OS runs your job efficiently to save battery. Use it for deferrable work like data syncs. Footgun: It's not for exact timing.

advanced2 min read

Handler and Looper: Android's Threading Backbone

A Looper is a worker that endlessly processes a queue of tasks for a thread. A Handler is how you give that worker a new task from another thread, like updating the UI. The footgun is blocking the main thread's Looper, which freezes your app.

The Testing Pyramid: Fast Feedback, Low Cost
easy2 min read

The Testing Pyramid: Fast Feedback, Low Cost

The Testing Pyramid guides test suite structure: a wide base of fast unit tests, a smaller middle of integration tests, and a tiny top of slow UI tests. This model is key for Android's local, instrumented, and UI tests. The footgun is inverting it.

JUnit on Android: Fast, Local Unit Tests
easy2 min read

JUnit on Android: Fast, Local Unit Tests

JUnit on Android runs tests directly on your local machine's JVM, not a device, making them extremely fast. Use it for business logic and ViewModels that don't touch Android APIs. The footgun is trying to access framework code like Context, which will fail.

easy2 min read

Truth: Fluent Assertions for Clearer Tests

Truth makes tests read like English: assertThat(actual).is.... It provides clearer assertions than standard JUnit, with far more helpful failure messages, especially for collections. The main footgun is a potential Guava dependency conflict.

Instrumentation Tests: Testing on a Real Android Device
easy2 min read

Instrumentation Tests: Testing on a Real Android Device

Instrumentation tests are like test-driving your app on a real device or emulator. They verify code that depends on the Android framework, like UI interactions or sensor access.

AndroidX Test: The Standard Android Testing Toolkit
intermediate2 min read

AndroidX Test: The Standard Android Testing Toolkit

AndroidX Test offers a unified API for all Android testing, from local unit tests to on-device UI automation. It's the standard for building robust, testable apps. The footgun: accidentally bundling test-only dependencies into your production APK.

intermediate2 min read

ActivityScenario: Test Your Android Activities in Isolation

ActivityScenario lets you launch and control an Android Activity's lifecycle within an instrumented test. Use it to verify UI behavior during events like screen rotation or process death, isolating the component for reliable testing.

Robolectric: Run Android Unit Tests on the JVM
intermediate2 min read

Robolectric: Run Android Unit Tests on the JVM

Robolectric runs Android unit tests on a regular JVM, not a slow emulator. Use it in CI/TDD to test logic like Activity lifecycles without the minutes-long build-deploy cycle. The footgun is over-mocking; Robolectric tests behavior, not just implementation.

Espresso for Android UI Testing
intermediate2 min read

Espresso for Android UI Testing

Espresso is an Android framework for automated UI tests. As an instrumented test, it runs on a device or emulator to simulate user interactions, helping you verify app behavior and UI correctness as part of a complete testing strategy.

Testing Coroutines: Control Time with `runTest`
advanced2 min read

Testing Coroutines: Control Time with `runTest`

Test asynchronous coroutine code as if it were synchronous. The kotlinx-coroutines-test library lets you control a virtual clock. Use runTest to wrap tests calling suspend functions, ensuring your test waits for async work before asserting results.

UI Automator: Black-Box UI Testing for Android
advanced2 min read

UI Automator: Black-Box UI Testing for Android

Think of UI Automator as a robot that tests your app by looking at the screen, not your code. It's for end-to-end tests that cross app boundaries, like interacting with the system Settings. The footgun: tests are powerful but can be slow and brittle.

easy2 min read

StrictMode: Your Main Thread's Watchdog

StrictMode is a developer tool that acts like a strict supervisor for your app's main thread, catching slow operations like disk or network access. It helps you find performance issues before they cause "Application Not Responding" errors.

Memory Leaks: The Silent App Killer
easy2 min read

Memory Leaks: The Silent App Killer

A memory leak is when your app holds onto objects it no longer needs, preventing memory reclamation. This often happens with static references to UI elements or background tasks. The footgun: your app won't crash immediately, but will slow down and die later.

Android App Startup: From Cold to Hot
intermediate2 min read

Android App Startup: From Cold to Hot

App startup has three types: cold, warm, and hot. Optimization focuses on the cold start—when the app launches from scratch. This is critical for user retention, as slow launches are a common reason for uninstalls. The footgun: don't just test warm starts.

Android Keystore System
intermediate2 min read

Android Keystore System

The Android Keystore System stores cryptographic keys in hardware backed secure storage instead of app memory or disk. Apps can use the keys to sign or encrypt data, but the raw key material never leaves the secure environment, even on a rooted device.

intermediate1 min read

EncryptedSharedPreferences: Secure Key-Value Storage on Android

EncryptedSharedPreferences is a drop-in replacement for SharedPreferences that automatically encrypts keys and values, protecting sensitive data at rest. Use it to store small, sensitive data like API tokens. The main footgun is mismanaging the master key.

intermediate2 min read

Android Biometric Authentication: The BiometricPrompt API

Android's BiometricPrompt is a unified API for fingerprint, face, or iris scans, replacing older, fragmented methods. Use it to authorize payments or unlock features. The footgun: never assume a specific biometric type is available; always have a fallback.

Android Baseline Profiles: Pre-compiling for Speed
advanced2 min read

Android Baseline Profiles: Pre-compiling for Speed

A Baseline Profile is a cheat sheet for the Android runtime, telling it which code to pre-compile for faster performance. This speeds up app startup and reduces UI jank in critical flows.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles