对于debbugin Android应用技巧应用技巧、debbugin、Android

2023-09-06 00:05:34 作者:Mr. Blue sky

我现在想提高​​我的编程技巧和特殊,我想现在你如何​​调试的情况下,应用程序滞后一点。我试图移动最关键的部分,以线程但我仍然得到一些ANR。我想我的程序是什么地方泄漏内存。

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, any suggestions on how to debug this?

谢谢!

推荐答案

我想你应该花一些时间阅读本http://developer.android.com/reference/android/os/StrictMode.html

I think you should spend some time reading this http://developer.android.com/reference/android/os/StrictMode.html

在严格模式参考页:

StrictMode最常用于   赶上意外的磁盘或网络   在应用程序的主访问   线程,在UI操作   接受和动画进行。   保持磁盘和网络操作   关闭主线程使得多   更顺畅,反应更灵敏   应用程序。通过保持你的   应用程序的主线程响应,   您还$由对$ pvent ANR对话   被显示给用户。

StrictMode is most commonly used to catch accidental disk or network access on the application's main thread, where UI operations are received and animations take place. Keeping disk and network operations off the main thread makes for much smoother, more responsive applications. By keeping your application's main thread responsive, you also prevent ANR dialogs from being shown to users.