开发者

Android debugging -> battery drains

Have you noticed a significant battery drain when debugging Android application on the phone?

开发者_StackOverflow社区Also, does a lot of Log.d() messages drains the battery?


Not really.

Is not your phone connected to your PC, and thus charging, while you perform debugging?

Every operation on Android drains battery, but I do not think Logging drain battery more than, say, drawing screen updates.


Yes! I just started debugging my Android apps on my phone (Motorola Droid) rather than on the emulator a few days ago because it's so much faster. Since then my battery life has become abysmal. Of course it doesn't get drained while I'm actually debugging because at that time the phone is connected to my PC and is charging from it. But the rest of the day my battery seems to drain much faster than it used to. When I look at the Battery Use screen in Settings it indicates that "Android OS" is using a significant amount of battery, far more than it ever did in the past. I have no idea what is causing this or how to fix it.


If your definition of "debugging Android application on the phone" is: you test your application while your phone is connected to your PC, then no. Your phone will charge all the time and the battery will get charged faster than it will drain, so you shouldn't have any worries.

On the other hand, if your phone isn't connected to PC, and you are calling Log.d() a LOT, let's say, 1,000,000 times in a loop, then yes, this will put a strain on your battery, since you will generate a lot of string statements that will appear under Logcat's logs and old logs will have to be discarded. Don't overdo it with logging messages.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜