Android Articles

Android Multimodal On-device AI: Gemini Nano, Image Tokens, Streaming, and Compose

A practical Android multimodal AI walkthrough covering Gemini Nano Multimodality, AICore model loading, image preprocessing, ViT tokenization, streaming inference, Compose rendering, memory, and thermals.

Inside Android CameraX: From Camera2 Pipeline to Compose Camera UI

Analyze CameraX's layered pipeline from HAL and Camera2 to UseCase APIs and Compose integration, with production lessons on focus, resolution, and leaks.

Android Testing in Practice: JUnit, Integration Tests, Compose Semantics, and CI

A practical Android testing strategy from ViewModel unit tests and Repository integration tests to Compose semantics UI tests and CI flaky-test governance.

Android Perfetto End to End: ftrace, TrackEvent, and Production Monitoring

A deep dive into Android Perfetto, from the traced and traced_probes daemon architecture to kernel ftrace sources, shared ring buffers, SDK TrackEvent instrumentation, and production observability.

Android Process Survival and Resource Scheduling: OOM Adj to LMK

A system-level look at Android OOM Adj scoring, LMK and lmkd evolution, cgroup memory isolation, foreground services, expedited WorkManager jobs, and memory self-monitoring.

Inside Android Room: KSP Code Generation, Migrations, and Flow Queries

Walk through Room's KSP-generated DAO code, migration strategy, and Flow reactive queries, from compile-time SQL validation to InvalidationTracker.

Jetpack Compose Animation Internals: AnimationSpec, Springs, and Transition

A deep dive into Compose animation internals, including spring physics, the Choreographer-to-Snapshot frame pipeline, and how Transition synchronizes multiple animated properties.

End-to-End Android On-Device AI Model Security: From Encrypted Storage to TEE Inference

A practical walkthrough of layered protection for Android on-device AI models, from encrypted storage and hardware-backed keys to TEE inference, with engineering constraints and tradeoffs.

Inside Android ViewModel: ViewModelStore Retention and SavedStateHandle Recovery

Trace ViewModel from ViewModelStore retention to SavedStateHandle process recreation, and separate configuration-change survival from process-death recovery.

Designing an On-Device LLM Inference Scheduler: Priority Queues and Backpressure in Practice

This article shows how to build a scheduling layer above an on-device inference engine, using priority queues, preemption, and backpressure to avoid OOMs, unpredictable latency, and out-of-order results.

Jetpack Compose Recomposition Performance: Stability, derivedStateOf, and Skipping

A practical end-to-end guide to diagnosing and optimizing Compose recomposition, covering stability inference, compiler reports, Layout Inspector, derivedStateOf, and state read placement.

Android Gradle Build Speed: From Configuration Cache to Replacing KAPT with KSP

A systematic Android Gradle build-speed guide covering configuration time, annotation processing, task execution, Configuration Cache, KSP migration, incremental compilation, and build governance.

Android MotionLayout Deep Dive: From Scene Constraints to KeyFrame Interpolation

A deep dive into MotionLayout as an animation state machine, covering ConstraintSet states, KeyFrame interpolation paths, MotionScene structure, and debugging practices.

Android On-device AI Real-time Video: CameraX Frames, GPU Preprocessing, and LiteRT Inference

A practical end-to-end Android real-time video AI pipeline, covering CameraX head-of-line blocking, GPU YUV preprocessing, LiteRT inference jitter, async staging, and frame-expiration control.

Android On-device AI Memory Management: Model Loading Peaks, Tensor Lifetimes, and KV Cache Reclaim

A practical memory-management path for Android on-device LLM deployment, covering mmap model loading, tensor lifecycle reclamation, sliding-window KV cache, layer-wise decay, and LMK survival.

Android On-device AI Prompt Engineering: Token Budgets, Few-shot Compression, and TTFT Control

A practical Android on-device LLM prompt-engineering guide showing how token budgeting, few-shot template compression, and dynamic budget switching reduced first-token latency from 8.7 seconds to under 2 seconds.

Android On-device AI System Health: Dynamic Inference Degradation by Thermal, Battery, and Memory Pressure

A practical three-dimensional degradation strategy for Android on-device AI inference, coordinating thermal status, battery state, and memory pressure with normalized scoring, model preloading, and state migration.

Android Paging 3 Deep Dive: PagingSource, RemoteMediator, and Reactive Pagination

A deep breakdown of Paging 3's three-layer architecture: Pager, PagingSource, and RemoteMediator, including Room, RecyclerView, coroutine dispatchers, caching, and common pitfalls.

Android SharedPreferences to DataStore Deep Dive: From ANR Risk to Flow-Based Coroutine Storage

A deep look at SharedPreferences locking and ANR root causes, Jetpack DataStore's design, migration paths, Preferences DataStore, Proto DataStore, and coroutine-based storage architecture.

Android WorkManager Scheduling: Constraints, Doze, Expedited Work, and Task Chains

A deep dive into WorkManager scheduling, the Constraint engine, Doze compatibility, task-chain orchestration, Expedited Work, foreground-service tradeoffs, and dumpsys debugging.