×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    32

    read gps coordinate

    dear sir
    i am new in j2me ,i want to display my current gps coordinate in a text field every 5 second

    could you send me the code
    with best regard

  2. #2
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: read gps coordinate

    Have a look in the wiki and/or look on the net for JSR-179...
    take into account you will need a device which has the JSR-179 Location API and and integrated GPS receiver and/or an external GPS receiver...

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    32

    Re: read gps coordinate

    dear sir
    i have found this code

    // Set criteria for selecting a location provider:
    // accurate to 500 meters horizontally
    Criteria cr= new Criteria();
    cr.setHorizontalAccuracy(500);

    // Get an instance of the provider
    LocationProvider lp= LocationProvider.getInstance(cr);

    // Request the location, setting a one-minute timeout
    Location l = lp.getLocation(60);
    Coordinates c = l.getQualifiedCoordinates();

    if(c != null ) {
    // Use coordinate information
    double lat = c.getLatitude();
    double lon = c.getLongitude();
    }


    i have created a textfield then i right click on it and choose go to source
    and i put the above code after

    textField = new TextField("textField", null, 32, TextField.ANY);
    // write post-init user code here

    but it give error

    could any one help me where to put the above gps code
    with best regard

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: read gps coordinate

    Hello souhir,

    please do not cross-post about same topic multiple times, you have asked about this very same topic also here: http://discussion.forum.nokia.com/fo...d.php?t=201008 and here: http://discussion.forum.nokia.com/fo...d.php?t=200999

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: read gps coordinate

    also it might be a good idea to actually post the error you are getting...
    with "it give error" we can't help a lot... it might be a JSR-179 specific error, it might be a J2ME standard libraries error, it might be the dog has to be taken out error, or a we finished the coffee error...

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: read gps coordinate

    I think there is no need to multipost let the discussion be unique.
    Your Same Thread is Here also
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. GPS Listener - different behavior in emulator
    By neil.young in forum Symbian
    Replies: 4
    Last Post: 2009-12-15, 08:59
  2. N60 GPS Turns off after 5 minutes usage.
    By acalabro in forum Mobile Java General
    Replies: 12
    Last Post: 2009-09-24, 12:03
  3. JSR 179: External Bluetooth GPS disable, internal GPS enable
    By insrla00 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-09-08, 09:38
  4. JSR-179API provider reset to stop GPS location activity
    By nicholso in forum Mobile Java General
    Replies: 15
    Last Post: 2009-02-06, 11:33

Posting Permissions

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