开发者

Debugging my android for an issue with wifi

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 no开发者_Python百科t 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜