调试Android应用程序? [英] debugging Android apps?

查看:95
本文介绍了调试Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在尝试提高我的编程技能,特别是现在我想如何调试应用程序滞后的情况。我试图将大多数关键部件移至线程,但仍然得到一些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.

那么,如何调试呢?

推荐答案

我认为您应该花一些时间阅读此 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操作是接收到的
并进行动画处理。
保持磁盘和网络操作不离开主线程
可使
更加平滑,响应更快的
应用程序。通过使
应用程序的主线程保持响应状态,
,您还可以防止
的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.

这篇关于调试Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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