I am now trying to improve my programming skills and specially I would like to now how you debug those situations where the app lags a bit. I tried to move most of the critical parts to threads but still I get some ANR. I guess my app is leaking memory somewhere.
So, how to debug this?
I think you should spend some time reading this http://developer.android.com/reference/android/os/StrictMode.html
From Strict Mode reference page: