Tagged articles
Looper
12 articles · Page 1 of 1
This article explains how to use reflection and dynamic proxies to hook the hidden Android Looper.Observer API for detailed message‑dispatch timing, demonstrates code examples for installing and removing the hook, discusses workarounds for hidden‑API restrictions and the .dex loading changes introduced in Android 14.
AndroidHidden APILooper
0 likes · 13 min read

This article explains how to use Android's hidden Looper$Observer API via reflection and dynamic proxies to monitor long‑running messages on the main thread, classify their execution time, and bypass hidden‑API restrictions, with complete code examples and practical tips for Android 10‑14.
AndroidHidden APILooper
0 likes · 11 min read

The DeWu ANR Monitoring Platform replaces Bugly with a comprehensive internal system that collects ProcessErrorStateInfo, tombstone files, main‑thread stack samples, Looper message histories, and app state, parses and aggregates this data, visualizes trends and root‑cause details, and guides developers in mitigating ANRs.
ANRAndroidLooper
0 likes · 15 min read

This article explains the relationship between UI stutter and ANR, critiques common monitoring tools, and presents three robust Android lag‑detection methods—WatchDog polling, Looper Printer replacement, and specialized handlers for IdleHandler, TouchEvent, and SyncBarrier leaks—complete with probability analysis and sample code.
ANRAndroidIdleHandler
0 likes · 17 min read

The article dissects Android’s Handler‑Looper‑MessageQueue architecture, explaining ThreadLocal‑based Looper binding, various Handler constructors, async versus sync messages, barrier handling, IdleHandler, HandlerThread and IntentService usage, and the differences between Handler.post and View.post for responsive UI development.
AndroidLooperMessageQueue
0 likes · 29 min read

This article explains how Android drives applications through a message‑driven model by detailing the roles of Message, MessageQueue, Looper, Handler, and ThreadLocal, and walks through the native implementation of ActivityThread's main loop, including prepareMainLooper, MessageQueue initialization, epoll integration, and the polling mechanisms that power the message processing cycle.
AndroidEpollLooper
0 likes · 17 min read

This article examines why DialogFragment can cause memory leaks in Android apps, analyzes the role of HandlerThread messages and Looper processing, and presents several mitigation strategies including avoiding dismiss listeners, using weak references, and custom fragment implementations to safely release resources.
DialogFragmentLeakCanaryLooper
0 likes · 11 min read

This article explains why performing UI updates—even on the main UI thread—can still trigger CalledFromWrongThreadException when a Dialog is created on a background thread, by analysing ViewRootImpl, Handler, Looper, and the view hierarchy with practical code examples.
CalledFromWrongThreadExceptionDialogLooper
0 likes · 16 min read

This article explains Android's Handler and Looper mechanism, shows why creating a Handler in a non‑Looper thread triggers a RuntimeException, and walks through the relevant source code—including Handler constructors, Looper.myLooper(), ThreadLocal operations, and the required Looper.prepare() call.
ANRAndroidConcurrency
0 likes · 10 min read

This article explains the design and implementation of Android's Handler mechanism, detailing how Handlers, Messages, MessageQueue, and Looper work together to enable thread communication, avoid memory leaks, and manage message sending, queuing, and processing, with source code examples and best practices.
AndroidLooperMessageQueue
0 likes · 21 min read

Android activity startup latency stems from three phases—Pause, Launch, and Render—so optimizing only onCreate often leaves perceived delays; developers can measure each phase via system logs or AOP hooks (Instrumentation, Looper‑Printer, or ActivityThread handler) to pinpoint and reduce bottlenecks.
ActivityAndroidLooper
0 likes · 21 min read

This article explains why Android UI lag hurts user experience, reviews traditional adb‑based detection methods, introduces a new in‑app monitoring system that leverages Looper log matching and Choreographer.FrameCallback to capture precise stack traces, and describes its implementation, performance impact, data processing pipeline, and real‑world results.
AndroidLooperUI lag
0 likes · 22 min read
