Namespaces
Variants
Actions

MIDlet cannot power down GPS module with an existing satellite fix (Known Issue)

Jump to: navigation, search
Article Metadata

Tested with
Devices(s): Nokia E90 Communicator, Nokia 6110 Navigator

Compatibility
Platform(s): S60 3rd Edition FP1

Article
Created: User:Technical writer 1 (02 Apr 2008)
Reviewed: skalogir (17 Nov 2011)
Last edited: hamishwillee (01 Mar 2012)
Archived.png
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|write your reason here}}.

Contents

Overview

When using Location API's (JSR-179) methods to get a proper provider, it is not possible to stop GPS module location activity if there is a GPS satellite fix, resulting in reduced battery life.

Note.png
Note: On Symbian Anna devices, this issue has been fixed, so stopping listening to location updates from within the application, results in reduced battery power consumption. See also Best practises for listening to location updates with Java ME.

Description

Location API's getInstance(Criteria criteria) method selects the location provider based on the defined criteria, where the value null indicates the least restrictive criteria with default values.

Example usage for acquiring location provider information with JSR-179:

..
LocationProvider locProvider;
..
locProvider = LocationProvider.getInstance(null);
locProvider.setLocationListener(this, -1, 0, 0); //setting listener for LocationProvider updates

When acquiring location provider information as defined above, the Location API does not stop GPS module location activity if there is a GPS satellite fix. When the location listener is stopped and the location provider is reset, the actual receiver does not stop and it does not power down (regardless of whether the satellite fix continues to be available or not):

locProvider.setLocationListener(null, -1, 0, 0); // setting registered listener cancelled   
locProvider.reset(); // resetting LocationProvider by aborting all pending synchronous requests

As a result, battery life is reduced to below 10 hours.

How to reproduce

Download and install Nokia Energy Profiler.

Implement a test MIDlet using this source code.

Procedures:

  1. Launch Nokia Energy Profiler. From Options, choose Start to begin measurement and check the initial battery level in the top right corner.
  2. Leave Nokia Energy Profiler running and exit it by pressing the Menu key.
  3. Launch the test MIDlet. The MIDlet starts searching for a fix. After a fix has been found, press Stop GPS. Leave the MIDlet running and exit it by pressing the Menu key.
  4. Resume to the Nokia Energy Profiler and check the battery level. It is now reduced to below 10 hours.
  5. Repeat step 2.
  6. Resume to the running MIDlet and close it by pressing Exit.
  7. Repeat step 4. The battery level will be slowly resumed. Close the Profiler by pressing Exit. Relaunch the Profiler and start the measurement again to view the improved battery level.

Solution

Exiting the MIDlet results in improved battery level on S60 3rd Edition, Feature Pack 1 devices. On Symbian Anna devices, this issue has been fixed, so stopping listening to location updates from within the application, results in reduced battery power consumption. See also Best practises for listening to location updates with Java ME.

Comments

Nicholso: 22/8/2008

Key issue: can future Java implementation allow J2ME application using JSR179API to be able to continue running AND make a call through JSR179API to power down the GPS hardware. Example use cases in other applications: Google Maps turn GPS off feature; Nokia Location Tagger gps timeout. Being forced to exit midlet is not a solution for location applications that need to continue running and release the GPS so that it powers down. And battery life is precious!

(Note: I added one extra catch for SecuirtyException in the code sample in StartGPS() method to handle when user says no to the Positioning security question.)


The name of this article is not so helpful. Using integrated GPS for GPS satellite fixes will always reduce battery life ;-)

A more helpful article name could be - "Active midlet using JSR-179API can not power down GPS module having an existing satellite fix"

Skalogir - Regarding powering down GPS with Java

Yes, it is possible to power down GPS in Java ME by using the code mentioned here.

I can see that the title has been updated to correspond more accurately to the issue.

skalogir 09:22, 28 February 2012 (EET)

This page was last modified on 1 March 2012, at 04:14.
185 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2012 All rights reserved