Avatar

Kai | Deep Android Engineering Notes

Deep notes on Android Framework, performance, Jetpack Compose, Kotlin, on-device AI, and mobile engineering.

Deep Android Engineering Notes

Android engineering knowledge base cover

A searchable knowledge base for Android Framework internals, performance optimization, Jetpack Compose, Kotlin coroutines, on-device AI, CI/CD, and mobile architecture.

Topic Index

Writing

Phased Android Startup Initialization with background and activity StartTypes

Putting every initialization task into Application makes cold-start cost unpredictable. This article presents a phased startup framework that separates background and activity StartTypes with explicit dependencies, thread scheduling, fallback behavior, and timing metrics.

Async Inflate Manager: Thread-Pool Preloading for Faster First Frames

First-frame latency is not only about network and image loading. Complex XML layout inflation on the main thread can be expensive too. This article presents an async Inflate manager that pre-creates Views on a thread pool, uses MutableContextWrapper for context safety, and falls back to UI-thread inflation when needed.

Bytecode try-catch Instrumentation for Third-Party Crashes: Precise Containment with hookPoint

When a third-party SDK crash cannot be fixed in source code, bytecode try-catch instrumentation can be a practical containment tool. This article explains a hookPoint-driven design for precise method matching, non-fatal exception capture, reporting, and safety boundaries.

Compose Multiplatform Desktop in Practice: JVM Windows and Platform Interop

A practical migration from Electron to Compose Desktop, covering JVM window management, menu bars, drag and drop, system trays, platform interop, packaging, and distribution. Startup time improved by 60% and memory usage dropped by 70%.

Custom Android Cache Strategies: FirstCache, FirstNet, OnlyNet, and Timeout

Cache strategy is more than choosing whether to read cache or network first. It affects screen speed, weak-network behavior, data consistency, and code complexity. This article presents a unified strategy enum, CacheManager layer, and Flow-based state model.

Dynamic Launcher Icons and Entry Switching: Engineering Controls Behind Icon Changes

Dynamic Launcher icons look like a single PackageManager call, but a production implementation involves manifest declarations, entry-state management, fallback behavior, launcher compatibility, and rollout controls.

A Unified Image Loading Facade with ImageUrlProcessor

If every page calls the image library directly, URL rules, size parameters, and preload logic scatter across the codebase. This article introduces a unified image-loading facade built around ImageUrlProcessor, preload scheduling, and observability.

Image Loading Stability: Custom SSL Verification and DoH DNS in Practice

Mobile image failures often come from certificate-chain validation issues, DNS pollution, or regional carrier-resolution problems. This article explains two network-layer improvements for image loading: explicit SSL verification and DoH-based DNS resolution.

Native/Web Route Rollouts: Low-Risk Page Migration with RedirectRouterInterceptor

When the same entry point has both Native and Web/H5 implementations, a route-level staged rollout is often the safest migration layer. This article explains how RedirectRouterInterceptor uses remote config, stable hashing, parameter mapping, fallback behavior, and structured monitoring to ship Native pages smoothly and roll back quickly.

Designing a Mobile Network Diagnostics System

The hardest part of mobile network failures is reconstructing what happened afterward. This article breaks down a practical diagnostics system: layered attribution, request-context capture, task orchestration, readable reports, privacy, and performance control.