正确跟踪日志消息

时间:2013-06-03 12:44:31

标签: android eclipse logging

我只是想知道我是否走在正确的轨道上。我已经习惯Netbeans java,但由于Eclipse最适合Android,我决定使用Eclipse。每当我在Eclipse上运行我的应用程序并检查日志消息时,我发现了很多警告,尽管它在模拟器和设备上都运行良好。但我希望这与后者app的有效性无关。有时候我的Eclipse会出现一些不必要的错误(代码中没有错误),这些错误会在关闭并重新启动时自行纠正(这是一个错误,我使用的是最新的Eclipse)。我将非常感谢您的评论。

以下是一些日志消息:

06-03 12:41:04.603: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.613: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.683: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.713: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.713: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.884: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.906: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.906: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.953: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.973: I/Choreographer(3395): Skipped 88 frames!  The application may be doing too much work on its main thread.
06-03 12:41:05.133: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.133: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.143: I/Choreographer(3395): Skipped 33 frames!  The application may be doing too much work on its main thread.
06-03 12:41:05.553: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.594: I/Choreographer(3395): Skipped 612 frames!  The application may be doing too much work on its main thread.
06-03 12:41:05.633: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.633: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.763: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.793: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.793: W/SoundPool(3395):   sample 0 not READY
06-03 12:41:05.854: D/PhoneStatusBar(3934): disable: < expand icons alerts ticker system_info BACK HOME recent* CLOCK search >
06-03 12:41:05.883: W/Trace(3511): Unexpected value from nativeGetEnabledTags: 0

LogCat收到的警告信息的序列我真的很想知道它是否正常。因为我没有在主线上完成太多工作。任何带有数据库查询的Activity都在中执行  Thread thread = new Thread(Runable); thread.start()。我需要澄清,因为我在空活动中得到同样的警告消息事件(我的意思是没有工作的活动)。我在这里需要认真的帮助,因为我不想做错误的事情,因为我在做写东西

1 个答案:

答案 0 :(得分:0)

此警告告诉您,您在UI线程上做了太多工作。那是主线索。这肯定会导致电池电量不足,电源不足或硬件不良的设备出现问题。您应该优化代码并在单独的线程中执行繁重的任务。你应该考虑使用AsyncTask - 一个可用于多线程的类。