×
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
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot addition of Template:ArticleMetaData)
hamishwillee (Talk | contribs)
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{ArticleMetaData
+
{{Archived|timestamp=20120223101822|user=roy.debjit| }}
 +
[[Category:Java ME]][[Category:Location]][[Category:Location API (JSR-179)]][[Category:GPS]][[Category:Known Issue]][[Category:S60 3rd Edition FP1]]
 +
{{ArticleMetaData <!-- v1.2 -->
 
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
+
|devices= Nokia E90 Communicator, Nokia 6110 Navigator
 
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
+
|platform= S60 3rd Edition FP1
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->  
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
|signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
+
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
|capabilities=<!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
+
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
|id= <!-- Article Id (Knowledge base articles only) -->
+
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
|language=<!-- Language category code for non-English topics - e.g. Lang-Chinese -->
+
|translated-by= <!-- [[User:XXXX]] -->
|review-by=<!-- After re-review: [[User:username]] -->
+
|translated-from-title= <!-- Title only -->
|review-timestamp=<!-- After re-review: YYYYMMDD -->
+
|translated-from-id= <!-- Id of translated revision -->
|update-by=<!-- After significant update: [[User:username]]-->
+
|review-by= skalogir
|update-timestamp=<!-- After significant update: YYYYMMDD -->
+
|review-timestamp= 20111117
|creationdate=20080402
+
|update-by= <!-- After significant update: [[User:username]]-->
|author=[[User:Technical writer 1]]
+
|update-timestamp= <!-- After significant update: YYYYMMDD -->
}}[[Category:Java ME]][[Category:Location]]
+
|creationdate= 20080402
__NOTOC__
+
|author= [[User:Technical writer 1]]
__NOEDITSECTION__
+
<!-- The following are not in current metadata -->
{{KBKI}}
+
|id= KIJ000875
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
}}
|-
+
|'''ID''' ||KIJ000875
+
|'''Creation date''' ||April 2, 2008; updated December 28, 2009&nbsp;
+
|-
+
|'''Platform''' ||S60 3rd Edition, Feature Pack 1&nbsp;
+
|'''Devices''' ||Nokia E90 Communicator, Nokia 6110 Navigator&nbsp;
+
|-
+
|'''Category''' ||Java ME&nbsp;
+
|'''Subcategory''' ||Location
+
|}
+
 
+
 
==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.
+
{{Abstract|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|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 ==
 
==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 {{Icode|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:
 
Example usage for acquiring location provider information with JSR-179:
 
+
<code java>
 
  ..
 
  ..
 
  LocationProvider locProvider;
 
  LocationProvider locProvider;
Line 49: Line 40:
 
  locProvider = LocationProvider.getInstance(null);
 
  locProvider = LocationProvider.getInstance(null);
 
  locProvider.setLocationListener(this, -1, 0, 0); //setting listener for LocationProvider updates
 
  locProvider.setLocationListener(this, -1, 0, 0); //setting listener for LocationProvider updates
 
+
</code>
 
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):
 
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):
+
<code java>
 
  locProvider.setLocationListener(null, -1, 0, 0); // setting registered listener cancelled   
 
  locProvider.setLocationListener(null, -1, 0, 0); // setting registered listener cancelled   
 
  locProvider.reset();  // resetting LocationProvider by aborting all pending synchronous requests
 
  locProvider.reset();  // resetting LocationProvider by aborting all pending synchronous requests
 
+
</code>
 
As a result, battery life is reduced to below 10 hours.
 
As a result, battery life is reduced to below 10 hours.
  
Line 63: Line 54:
 
Implement a test MIDlet using this  
 
Implement a test MIDlet using this  
 
[http://www.developer.nokia.com/Community/Discussion/showthread.php?124336-JSR-179API-provider-reset-to-stop-GPS-location-activity&s=61e0dd35b6dca11ae234fcbee160e0a9&p=376467 source code].
 
[http://www.developer.nokia.com/Community/Discussion/showthread.php?124336-JSR-179API-provider-reset-to-stop-GPS-location-activity&s=61e0dd35b6dca11ae234fcbee160e0a9&p=376467 source code].
 
  
 
Procedures:
 
Procedures:
 
+
# Launch Nokia Energy Profiler. From Options, choose Start to begin measurement and check the initial battery level in the top right corner.
1. Launch Nokia Energy Profiler. From Options, choose Start to begin measurement and check the initial battery level in the top right corner.
+
# Leave Nokia Energy Profiler running and exit it by pressing the Menu key.  
 
+
# 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.  
2. Leave Nokia Energy Profiler running and exit it by pressing the Menu key.  
+
# Resume to the Nokia Energy Profiler and check the battery level. It is now reduced to below 10 hours.
 
+
# Repeat step 2.
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.  
+
# Resume to the running MIDlet and close it by pressing Exit.
 
+
# 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.
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 ==
 
== Solution ==
  
Exiting the MIDlet results in improved battery level.
+
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]].
 
+
[[Category:Location API (JSR-179)]]
+
[[Category:GPS]][[Category:Known Issue]]
+

Revision as of 07:10, 28 June 2012

Archived.pngArchived: 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|user=~~~~|write your reason here}}.

Article Metadata
Tested with
Devices(s): Nokia E90 Communicator, Nokia 6110 Navigator
Compatibility
Platform(s): S60 3rd Edition FP1
Symbian
S60 3rd Edition FP1
Article
Created: User:Technical writer 1 (02 Apr 2008)
Reviewed: skalogir (17 Nov 2011)
Last edited: hamishwillee (28 Jun 2012)

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.pngNote: 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.

123 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×