×
Namespaces

Variants
Actions
(Difference between revisions)

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

From Nokia Developer Wiki
Jump to: navigation, search
Forum Nokia KB (Talk | contribs)
Forum Nokia KB (Talk | contribs)
Line 1: Line 1:
[[Category:Java ME]][[Category:Location API (JSR-179) ]][[Category:Location Based Services]][[Category:GPS]][[Category:Known Issue]]
+
[[Category:Java ME]][[Category:Location API (JSR-179)]][[Category:Location Based Services]][[Category:GPS]][[Category:Known Issue]]
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
{{KBKI}}
 
{{KBKI}}
{{KnowledgeBase
+
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
|id=KIJ000875
+
|-
|platform=S60 3rd Edition, Feature Pack 1
+
|'''ID''' ||KIJ000875
|devices=Nokia E90 Communicator, Nokia 6110 Navigator
+
|'''Creation date''' ||April 2, 2008; updated December 28, 2009 
|category=Java ME
+
|-
|subcategory=Location API
+
|'''Platform''' ||S60 3rd Edition, Feature Pack 1 
|creationdate=April 2, 2008
+
|'''Devices''' ||Nokia E90 Communicator, Nokia 6110 Navigator 
|keywords=
+
|-
}}
+
|'''Category''' ||Java ME 
 +
|'''Subcategory''' ||Location API 
 +
|}
  
 
==Overview==
 
==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.
 
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.
  
==Description==
+
==Description ==
 +
 
 
Location API's <tt>getInstance(Criteria criteria)</tt> method selects the location provider based on the defined criteria, where the value null indicates the least restrictive criteria with default values.
 
Location API's <tt>getInstance(Criteria criteria)</tt> 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:
 
Example usage for acquiring location provider information with JSR-179:
  
  ..
+
..
  LocationProvider locProvider;
+
LocationProvider locProvider;
  ..  
+
..  
  locProvider = LocationProvider.getInstance(null);
+
locProvider = LocationProvider.getInstance(null);
  locProvider.setLocationListener(this, -1, 0, 0);  
+
locProvider.setLocationListener(this, -1, 0, 0); //setting listener for LocationProvider updates
  //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 LocationListener 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):
+
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);  
+
locProvider.setLocationListener(null, -1, 0, 0); // setting registered listener cancelled   
  // setting registered listener cancelled   
+
locProvider.reset();  // resetting LocationProvider by aborting all pending synchronous requests
  locProvider.reset();   
+
  // resetting LocationProvider by aborting all pending synchronous requests
+
  
 
As a result, battery life is reduced to below 10 hours.
 
As a result, battery life is reduced to below 10 hours.
  
==How to reproduce==
+
== How to reproduce ==
 +
 
 
Download and install [http://www.forum.nokia.com/info/sw.nokia.com/id/324866e9-0460-4fa4-ac53-01f0c392d40f/Nokia_Energy_Profiler.html Nokia Energy Profiler].
 
Download and install [http://www.forum.nokia.com/info/sw.nokia.com/id/324866e9-0460-4fa4-ac53-01f0c392d40f/Nokia_Energy_Profiler.html Nokia Energy Profiler].
  
Line 50: Line 52:
 
2. Leave Nokia Energy Profiler running and exit it by pressing the Menu key.  
 
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.  
+
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.
 
4. Resume to the Nokia Energy Profiler and check the battery level. It is now reduced to below 10 hours.
Line 61: Line 63:
  
  
==Solution==
+
== Solution ==
 +
 
 
Exiting the MIDlet results in improved battery level.
 
Exiting the MIDlet results in improved battery level.

Revision as of 15:57, 28 December 2009

Template:KBKI

ID KIJ000875 Creation date April 2, 2008; updated December 28, 2009 
Platform S60 3rd Edition, Feature Pack 1  Devices Nokia E90 Communicator, Nokia 6110 Navigator 
Category Java ME  Subcategory Location API 

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.

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.

64 page views in the last 30 days.
×