Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Testing and Deployment

Reply
New Developer
Posts: 27
Registered: ‎09-19-2008
My Device: 8900

Battery problem

I have a battery problem with my application.

 

Basically I open a screen but into screen I'm running a thread for gps listener. this listener is retrieving gps locations and sending to http handler.

 

The problem I have is, if I have application opened, is consuming battery a lot and the device is geting hot, battery temperature is going up, but If I send app to background is consuming battery normally.

 

Any suggestion

BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Battery problem

GPS, cellular network communication and the LCD screen are the major power consumers on a mobile device.  If you are constantly using all 3 you will have a noticeable impact on battery life.  I recommend reading this:

 

BlackBerry features and their impact on battery life

http://supportforums.blackberry.com/t5/Java-Development/BlackBerry-features-and-their-impact-on-batt...

 

You may want to reduce the frequency of your GPS polling.  If you don't need live data on the server side you could store the data locally on the BlackBerry Smartphone and upload it in batches.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 27
Registered: ‎09-19-2008
My Device: 8900

Re: Battery problem

I already readed that document.

 

Sittuation is very weird.

 

Initially I push a screen, and into that screen I run a background thread for GPS.

 

If over that screen I push another screen, the background thread continue running, and the application stop consuming battery.

 

the problem appears just when the screen containing the thread is in foreground.

 

Any suggestion ?

New Developer
Posts: 27
Registered: ‎09-19-2008
My Device: 8900

Re: Battery problem

Actually, my GPS class is getting locations every 10 seconds (to avoid gps go cold), saving 1 location every 60 seconds, and sending 5 locations every 5 minutes.

 

If you run application, and show screen where gps thread is located, the battery is consuming a lot (aprox 1% every minute), and the phone is burning.

 

If click home button, and send application to background, everything works great (in background), battery is consuming aprox 1% every 20 minutes, and the phone keeps cold.

 

The problem is just when show the application in the foreground.

 

Im fighting with this problem a lot of time, and I cant found a solution.

 

This is part of my code:

 

	//Screen constructor, im implementing my TemplateScreen class (FullScreen type)
	public ScrMenu() {

		// this method create all the elements for the screen
		crearPantalla();  
		IniciarGPS();
		

	}

	private void IniciarGPS() {
		
		//This is my GPS Thread
		bbGeo = new GeoLocatorEngine();

		//IM setting my listener to get information from GPS Thread to the screen
		bbGeo.SetListener(new LWEventListener() {
			public void eventAction(LWEventListenerMessage message, Object object) {
				if (message.messageType == 1) {

						//This method set a label field into this screen
						UpdateStatus(message.messageString);
				}
			}
		});
		bbGeo.start();
	}

 

 Additionally, my TemplateScreen, adds a header, main container manager and footer for all my screens.

 

Please help !!!

BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Battery problem

What BlackBerry Smartphone model and BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.

 

Can you provide a full sample that triggers this behaviour?  If you don't wish to post it publicly, you can create an issue in Issue Tracker.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
New Developer
Posts: 27
Registered: ‎09-19-2008
My Device: 8900

Re: Battery problem

Im using one 9300 And 9100, Both have the problem.

I will send the complete code for your revision throw issue tracker