StrictMode更低版本的平台 [英] StrictMode for lower platform versions

查看:132
本文介绍了StrictMode更低版本的平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用Android StrictMode,发现这将是巨大的,有它总是在开发过程中运行,而不仅仅是我的混帐创建了一个特殊分支。我这样做的原因是我的应用程序要求使用1.6及更高版本上运行。

I have started using the Android StrictMode and find that it would be great to have it always running during development and not just on a special branch I created in git. The reason I did this is my apps requirement to run with 1.6 and up.

我看在Android开发者博客让你通过反射激活它,你可以将它设置。我只是想知道如何将真正的样子,如果有可能到这里该记录(或其他地方),而不是每个人都想要使用它制定出自己。

I read on the android developer blog that you can set it up so that you activate it via reflection. I was just wondering how that would actually look like and if it might be possible to have this documented here (or somewhere else) rather than having everybody that wants to use it work out themselves.

推荐答案

所以我不想等待,并决定作出努力和实现这个我自己。它基本上可以归结为包装StrictMode在一个包装类,并通过反射在运行时决定,如果我们能够激活它。

So I did not want to wait and decided to make the effort and implement this myself. It basically boils down to wrapping StrictMode in a wrapper class and deciding at runtime via reflection if we can activate it.

我已经证明它的细节在一篇博客文章并使它在<一个可用href="https://github.com/mosabua/maven-android-plugin-samples/tree/master/morseflash">github.

I have documented it in detail in a blog post and made it available in github.

这篇关于StrictMode更低版本的平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆