Stricter StrictMode
summary
Android O adds about three new StrictMode detectors and expands thread and VM policies that catch disk reads/writes, network access, unbuffered IO, leaked Activities/Closables and more. Developer builds should enable all detectors but use weaker penalties first; options include penalty death, dialog, log or flashing border. Workarounds include reapplying policy with postAtFrontOfQueue in application onCreate because of a policy-clobber bug, and a reflection hack to intercept violations (replace thread‑local list or VM hashmap). Fixes: move work off UI thread, buffer IO, and always close resources.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:12What is StrictMode
- 3:21Why performance matters
- 5:27Detectors in StrictMode
- 9:00VM policy violations
- 12:14Enabling StrictMode
- 15:45Penalty options
- 18:56Custom callbacks
- 23:31Fixing violations
- 28:30Summary and Q&A
related talks
28mBest practices for running background work on Android
34mChange Can be Good: The New World of Android Oreo
45mHigh performance in Android
42mBuilding for Android O
29mSecuring Android Applications - The not so se…
38mAdvanced Techniques for Protecting Android Apps
46mDeveloping for Android: the Naughty Bits
38mOptimize your app performance for the next generation of Android
