1 / 7
文档名称:

安卓开发之调试实例.doc

格式:doc   大小:44KB   页数:7页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

安卓开发之调试实例.doc

上传人:wdwd123321123 2019/10/24 文件大小:44 KB

下载得到文件列表

安卓开发之调试实例.doc

相关文档

文档介绍

文档介绍:安卓开发之调试实例2012年5月22日14:51来源:安卓中文网我有话说(0人参与) packageAndroidApi; ; classMonitoringimplementsRunnable { publicvoidrun() { while(!().isInterrupted()) { try { (100); }catch(InterruptedExceptions) { ().interrupt(); } (); } } } lassAndroidDebug { privatestaticbooleanm_bIsDebug=false; /** *设置调试模式* ****@parambIsDebug */ publicstaticvoidsetMode(booleanbIsDebug) { m_bIsDebug=bIsDebug; } /** *是否调试模式****@return */ publicstaticbooleanisDebug() { returnm_bIsDebug; } /** *打印信息* ****@paramstrTxt */ publicstaticvoidprintln(StringstrTxt) { if(m_bIsDebug) { (strTxt); } } /** *打印信息* ****@paramstrTxt */ publicstaticvoidLog(StringstrTag,StringstrTxt) { if(m_bIsDebug) { (strTag,strTxt); } } /** *强制回收垃圾,可用于检测析构函数,检测未使用对象是否有*/ publicstaticvoidgc() { if(m_bIsDebug) { (); } } /** *打印堆总量*/ publicstaticvoidprintTotalMemory() { Runtimer=(); ("Totalmemoryis:"+()); } /** *打印堆剩余量*/ publicstaticvoidprintFreeMemory() { gc();//执行强制回收以获得准确的剩余量 Runtimer=(); ("Freememoryis:"+()); } /** *打印堆变化量*/ staticlonglongPre=0; publicstaticvoidprintVaryMemory() { gc();//执行强制回收以获得准确的剩余量 Runtimer=Run