My smartphone scared me

Two days ago my cellphone started to eat the battery very fast. I’ve got a Samsung Galaxy Ace, a smartphone with Android 2.3.x on board. I’ve bought it new maybe five months ago, the battery was new. The battery usually lasted for two to three days, in extreme cases it was like four. Two days ago the phone started to consume the whole battery in twelve hours. I was worried, because I can’t buy a new battery to a new phone. Checked if it’s not swollen, it’s alright. I thought to myself that the device started to do weird stuff. Since it’s a smartphone, then it probably was the software.

I hear to the radio on my way to work. The radio application works like this: plugin the headphones, without them it won’t start, start application, the app unmutes or you have to unmute by hand, a background service is started and you can leave the app. The background service runs until you mute the radio, then when Android OS cleans unused services it stops itself. The thing was it actually didn’t and was running in the background the whole time. It was the cause of the increased battery consumption.

What I did to recover from this state. I started task manager (Home button long press on Home screen) and went to Active applications tab. Turned off the radio. TO be sure I restarted the phone.

Sometimes an application that starts a background service does not stop it properly in case of an error. This is a good lesson about services, when I will program my application, I will double check that my service does not run forever causing increased battery consumption.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s