Testing for Debugging Code and Verbose Error Logging
To determine whether
StrictMode is enabled, you can look for the
StrictMode.setVmPolicy methods. Most likely, they will be in the
detectDiskWrites() detectDiskReads() detectNetwork()
penaltyLog() // Logs a message to LogCat penaltyDeath() // Crashes application, runs at the end of all enabled penalties penaltyDialog() // Shows a dialog
Have a look at the best practices for using StrictMode.
There are several ways of detecting
StrictMode; the best choice depends on how the policies' roles are implemented. They include
- a warning dialog,
- application crash.