Horje

Android - Strict Mode Policy : A tool to catch the bug in the Compile Time.
Start
  The below Code Snippet is to setup the StrictMode for Thread Policies. This Code is to be set at the entry points to our application.
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()  
    .detectDiskWrites()  
    .penaltyLog() //Logs a message to LogCat  
    .build())

  The below code deals with leaks of memory, like it detects when in SQLLite finalize is called or not.
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()  
    .detectActivityLeaks()  
    .detectLeakedClosableObjects()  
    .penaltyLog()  
    .build()); 

Remarks

StrictMode is basically a tool to catch the bug in the Compile Time mode. Using this we can avoid the memory leaks in our applications.


Read Article
https://develop.horje.com/learn/1434/reference