06-21-2010 08:08 PM
I recently made a few changes in my app and appear to have caused a somewhat dramatic change in power consumption / reduction in battery life. For testing purposes I created a new background network thread - it is not doing more work than my network thread, but its using the new network api and has some small tweaks. and since im testing, im running both at the same time. but since they do very little work i wouldnt expect it to be a huge issue. Also i've added a in-screen loading/wait message with an animated gif. its basically always running on the app screen, its just made visible/hidden when appropriate. could that animation thread be causing problems?
06-21-2010 08:25 PM
Have you seen this?
This would suggest that the network activity that you are doing has the most signidicant impact. However I think the animation is causing the issue. I would test this, by simply not running it. Let us know how you get on.
06-22-2010 08:39 AM
Yes i saw that thread, but the focus seems to be on how GPS kills your battery (which im not using). There are only a very few network connections (estimate 20-30 a day?) doing minimal work. the thread(s) are always running in the background, waiting for a request. i was hoping to add a pull/checkin since im not sure i can do push through my BES, but if my network connections are what are causing the problem now, adding many more wont be an option.
im going to try disabling the timertask on the loader screen that increments the frame count for the animated gif and see if it makes a difference. sucks b/c i'll have to wait all day to see if it makes a difference unless there are any other methods of determining battery drain?
06-22-2010 09:09 AM
similar to gps the network connections have an idle mode where less battery is consumed. every time you do any networking the network "wakes up" and consumes additional battery.
regular tasks should be done not too often if it can be avoided.
06-22-2010 10:08 AM
I know there have been people looking for task managers/CPU/memory usage monitors ... is there anything like that? I havent seen anything in the API to show cpu or memory usage for an app. how do other developers test the impact of certain threads or new additional functions that they are adding to their apps?
06-22-2010 10:13 AM
you can use profiling in the jde debugger maybe. the APIs are not telling you very much.
07-01-2010 09:31 AM
so i had no idea that eclipse had profiling abilities (i should pay more attention to find out about these things ... and apparently stop using so many hashtables). unfortunately im not sure either the eclipse or jde profiles/debuggers are going to help figure out my battery problems.
I changed my loader screen so that my show/hide loader methods start and stop an animation thread instead of it always running. But that didnt seem to make any difference in battery life. My only other main change i can think of was changing to the ConnectionFactory from the standard pre-5.0 method of making a network connection, but no idea why that would cause a problem. it must be some other random change i made somewhere. ill keep looking.
07-14-2010 08:07 AM
Hi Guys ,
I am facing somewhat same issue.
07-14-2010 08:20 AM
use push, not pull. it's blackberry, after all
07-14-2010 08:29 AM
Here are some of my experiences from actual expirements that I have done :
1) Network activity is worse than phone calls in draining battery.
2) Staying constantly connected will be a battery killer. If you need to wait for alerts that can come at anytime the best and only non-battery killing way would be to use PUSH, which is free.
3) Checking 30 times a day isn't terrible but if you could get away with once an hour that should be fine.
4) To test your app for battery drainage I think of it in % drain per hour. Normal usage runs around 5% per hour. If run with your app for an hour or 2 you can see how much the battery was used and if it is much more than 5% you may have an issue.
Hope this helps.