调试我的 android 的 wifi 问题

发布于 2024-11-09 03:31:18 字数 354 浏览 0 评论 0原文

我是 Android SDK 新手。也许这里有人可以向我展示如何调试 Android 启用并保持 wifi 打开时遇到的以下问题。

我自己有一台三星 Galaxy ACE s5830,几天前才收到,发现这个问题,手机在打开 wifi 时显示错误。然后我重新启动手机,发现wifi工作正常。此后,我开始注意到,当键盘被锁定时(充电时和空闲时),手机偶尔(一天两到三次)会因黑屏而挂断。当我尝试解锁键盘时,手机没有响应。然后我必须断开电池连接或按住电源键 10 秒钟才能让我的手机恢复活力。不过,我可以看到,如果我关掉wifi,电话就不会挂断。

我已在我的 PC 中安装了 SDK 和 Dalvik 调试监视器,但我想知道如何在连接手机的情况下调试此问题。提前致谢。

I am new to Android SDK. Maybe someone here can show me how to debug the following problem I have with my Android enabling and keeping the wifi switched on.

I have myself a Samsung Galaxy ACE s5830 which I got just few days back and had found this problem where the phone just displayed error while switching on wifi. I then restarted the phone and found that wifi was working fine. After this I began noticing that the phone occasionally (two or three times a day) got hung up with a blank screen while the keypad is locked (while charging and while idle). When I tried unlocking the keypad, the phone do not respond. I would then have to disconnect the battery or press and hold the power key for 10 seconds to bring my phone back to life. However, I can see that if I switch off wifi, the phone does not get hung up.

I have installed SDK and Dalvik Debug Monitor in my PC but I would like to know how I will be able to debug this issue with the phone connected. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盛夏已如深秋| 2024-11-16 03:31:18

如果我理解正确的话,当您使用 WiFi 处于活动状态的充电器并且设备进入睡眠状态时,就会出现此问题。

您可以尝试通过 USB 将手机连接到计算机并保持“adb logcat”或其 DDMS-window 等效项运行来尝试了解该问题,并查看如果它死机是否会显示任何有趣的内容。但是,您可能会陷入无关的消息中,直到您真正熟悉什么是正常的(一直有很多奇怪的错误/警告)和什么是不正常的。重新启动后,您可以查看 /proc/last_kmsg 之类的内容

顺便说一句,如果问题发生在电源充电器上,但在连接到电脑时却没有(刚刚连接,未安装 SD 卡且 DDMS 未运行),则可能表明罪魁祸首是来自充电器的电噪声。

或者您可以尝试解决它。有些设备的设置菜单中有一个选项,可以在连接到充电器时保持“开启”状态。

我相信您还可以编写一个应用程序来侦听 ACTION_BATTERY_CHANGED 意图,检测您是否已使用充电器,查明 wifi 是否打开,以及是否获取唤醒锁。您还需要关闭充电器或禁用 wifi,此时您将释放唤醒锁。

If I understand correctly, this issue occurs when you are on a charger with wifi active and the device goes to sleep.

You might attempt to understand the issue by connecting the phone to your computer via usb and leaving "adb logcat" or its DDMS-window equivalent running, and see if anything interesting is shown if it dies. But you may just get buried in extraneous messages until you have some real familiarity with what is normal (lots of weird errors/warnings all the time) and what isn't. After a restart you can look at things like /proc/last_kmsg

Incidentally, if the problem happens on the mains charger but not when connected to the pc (just connected, SD card not mounted and DDMS not running), that could suggest the culprit is electrical noise from the charger.

Or you could attempt to work around it. Some devices have in their settings menu an option to stay "on" whenever connected to a charger.

I believe that you could also write an application which listens for ACTION_BATTERY_CHANGED intents, detects that you have gone on the charger, finds out if wifi is on, and if it is acquires a wakelock. You'd also look for going off the charger or disabling wifi, at which point you would release the wakelock.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文