I have target sdk set as 3.2 and min sdk as 2.2, how can I use strictmode in my application, as I understand it is introduced but cannot really understand how to start using it.
My suggestion is two-fold:
First, add some baseline StrictMode code to your Application's onCreate()
. This lets you apply StrictMode to your entire app in an easy fashion (though you could put this code anywhere for more specific testing). There's good sample code in the StrictMode docs.
Second, detect the version of the SDK before trying to use StrictMode. This way, you only use StrictMode in API versions 9 or above - if you don't do this check, you'll crash your app on older versions of Android. You can easily detect the SDK version by looking at Build.VERSION.SDK_INT.
Optionally, you may want to only enable StrictMode when you're testing. How you do this is up to you, though I've written up one solution for this in the past.