Question

I was googleing the enableing StrictMode prior 2.3 but I couldn't find anything useful. All I found was that StrictMode is introduced in 2.3 and you can use reflection to check if there is strict mode like this

try {
Class sMode = Class.forName("android.os.StrictMode");
Method enableDefaults = sMode.getMethod("enableDefaults");
enableDefaults.invoke(null);
}
catch(Exception e) {
// StrictMode not supported on this device, punt
Log.v("StrictMode", "... not supported. Skipping...");
}

But is there any way to enable strict mode in versions prior 2.3 ? For example Fragments api is for 3.0 but with fragments api library included in code there is option to use fragments with all versions above 1.6. Is there something like this for strict mode ? or is there any workaround to use strict mode in versions prior 2.3 ?

Thanks

Was it helpful?

Solution

Why do you want to use strict mode prior 2.3? And how? The recommended way to use StrictMode is to turn it on during development, learn from it, and turn it off before you ship your app. Even if you don't want to support 2.3 and higher (though I can't imagine why) you can change the target version to 2.3, debug your app and set it back to your required level.

That's why I don't see the necessity for a support package. And google won't provide one...

Maybe you missed this article from the StrictMode developer.

Cheers

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top