调试简单的Andr​​oid项目 [英] Debugging simple android project

查看:156
本文介绍了调试简单的Andr​​oid项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Java和超过我是新来的Andr​​oid。阅读和尝试一些教程,我在想,使MP3播放器应用程序,但我已经卡住后。我以为我的运行时错误是在下面的方法,更具体地说if条件。

I'm new to Java and more than I'm new to Android. After reading and trying some tutorials I was thinking to make an mp3 player application, but I'm stuck already. I assume that my runtime error is in the following method and more specifically the if condition.

public void pausePlay(){
    if(player.isPlaying()){
        demoPause();
    } else {
        demoPlay();
    }
}

也许我就可以解决我的问题,但我的调试器不工作。或我不知道如何使用调试器。下面的链接是我的调试,的 DDMS 和的 LogCat中。同样在 github上我贴我的仓库。

Maybe I'll be able to solve my problem, but my debugger doesn't work. Or I don't know how to use the debugger. The following links are a printscreen of my debugger, DDMS and LogCat. Also on github I posted my repository.

推荐答案

在Eclipse中尝试以下步骤来调试code:

In eclipse try the following steps to debug your code:

1.Put在code一个破发点,你觉得问题(应用程序将在设备暂停,当它达到了code以后可以继续$ p来看看code流$ pssing F6)

1.Put a break point in your code where you think the problem is(the app will pause in device when it reaches that code later you can continue to look code flow by pressing F6)

2.Click ddms->设备 - >如果设​​备连接,它会显示你的进程列表,选择你的进程,然后点击设备顶部的绿色图标调试

2.Click ddms->device-> If the device is attached it will show you the list of processes, select your process and click green debug icon at top of device.

3.Run您的应用程序,当code流量达到破发点的应用程序将暂停一个对话框出现在日食单击Yes继续。接下来,您可以继续在Eclipse中调试。

3.Run your app, when the code flow reaches break point app will pause a dialog appears in eclipse click yes to continue. Next you can continue debugging in eclipse.

这篇关于调试简单的Andr​​oid项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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