×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    1

    Turning on/off GPS in J2ME on 6210 Navigator

    Dear collegues!

    I am developing a MIDlet which uses (must use) GPS. I am using J2ME (JSR 179 Location API) on Nokia 6210 Navigator. I have 2 problems regarding turning on and off the GPS.

    1. Turning off the GPS seems to be impossible. I use and have tried several combinations of:
    locationProvider.setLocationListener( null,... );
    locationProvider.reset();
    locationProvider = null;

    2. Turning on the GPS seems to be difficult with a call to
    locationProvider.setLocationListener( this,... );
    (this is an object implementing LocationListener)
    The MIDlet or another MIDlet must use
    locationProvider.getLocation() first to get
    the GPS going.

    When I say difficult I mean that it sometimes turns on, sometimes not.

    Has anyone solutions on these problems or at least seen them?

    (I think has something to do with threads inside LocationProvider)

    Best regards, J

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: Turning on/off GPS in J2ME on 6210 Navigator

    I'm not a Java expert, and since your question is related specifically to the Java APIs I think you should ask about them in the Java forum.

    However, there should be no need for turning off the GPS device as such, disconnecting from the service provider should be enough and it will be the provider that turns the hardware off when it is no longer serving any clients.

    As for acquiring the first fix, if that is the issue, that could be a rather lengthy process, depending of the characteristics of the location where you're running the tests.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    7

    Re: Turning on/off GPS in J2ME on 6210 Navigator

    Quote Originally Posted by jankarlberg View Post
    Dear collegues!

    1. Turning off the GPS seems to be impossible. I use and have tried several
    Has anyone solutions on these problems or at least seen them?

    (I think has something to do with threads inside LocationProvider)

    Best regards, J
    Note that the GPS is kept running for some time, after you request not to use it anymore. For your device it would be 30 seconds. Could you check this ?

    Disconnect from the service provider, and wait more than 30 seconds.

    Br, Jesper Sandberg.
    Last edited by jesandbe; 2008-09-30 at 18:13. Reason: Email notification

  4. #4
    Registered User
    Join Date
    Oct 2006
    Location
    Jyväskylä
    Posts
    5

    Re: Turning on/off GPS in J2ME on 6210 Navigator

    Hi

    I've got the same problem with this mobile with turning off gps. For sure it's bug in implementation of Location API. Here is solution how to turn off gps:

    If you got reference to LocationProvider object set it to null and invoke garbage collector:

    LocationProvider lp = LocationProvider.getInstance(criteria);
    ...
    ...
    lp = null;
    Runtime.getRuntime().gc();



    Hope it will save someone's time for looking for solution.


    Regards,

    Maciej

Similar Threads

  1. Final Year Project J2ME GPS
    By mustafabasarir in forum Mobile Java General
    Replies: 24
    Last Post: 2010-10-27, 10:31
  2. How can the WAP browser communicate to J2ME application?
    By hbfornies in forum Mobile Java General
    Replies: 20
    Last Post: 2007-03-02, 16:32
  3. GPS to J2ME Nokia mobile
    By xnes in forum Mobile Java General
    Replies: 3
    Last Post: 2005-02-11, 13:52
  4. J2ME Polish Version 1.0 RC6
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-07-20, 11:25
  5. How to make GPS working with J2ME
    By kokoadi in forum Mobile Java General
    Replies: 3
    Last Post: 2003-05-02, 22:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •