×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Dev cert for JSR 179

    Hi

    I am trying to run simple GPS coordinate code on N95 which gets lat and long of current place. But when I run it. It restarts phone.

    Do we require special dev cert from Nokia to access JSR 179.

    Here is my sample code

    package gps;

    //import com.sprintpcs.util.Location;
    import java.io.*;
    import java.util.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    //import javax.microedition.location.Location;
    import javax.microedition.location.Criteria;
    import javax.microedition.location.Location;
    import javax.microedition.location.LocationProvider;
    import javax.microedition.location.QualifiedCoordinates;

    public class GPSLocation extends MIDlet implements CommandListener {

    Command Exit = new Command("Exit", Command.EXIT, 0);
    Form f = new Form("wait");

    public GPSLocation() {
    }

    public void startApp() {

    f.append("geting gps data.");
    f.addCommand(Exit);
    f.setCommandListener(this);
    Display.getDisplay(this).setCurrent(f);
    try {
    Criteria c = new Criteria();
    c.setHorizontalAccuracy(1000);
    c.setVerticalAccuracy(1000);
    c.setPreferredPowerConsumption(Criteria.POWER_USAGE_HIGH);
    LocationProvider lp = LocationProvider.getInstance(c);
    Location loc = lp.getLocation(60);
    QualifiedCoordinates qc = loc.getQualifiedCoordinates();
    f.append("Alt: " + qc.getAltitude());
    f.append("Lat: " + qc.getLatitude());
    f.append("Long: " + qc.getLongitude());
    } catch (Exception e) {
    f.append("Exception: " + e);
    }
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean destroy) {
    }

    public void commandAction(Command c, Displayable s) {
    if (c == Exit) {
    destroyApp(true);
    notifyDestroyed();
    }
    }
    }

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Dev cert for JSR 179

    No, you do not need a special certificate to access the JSR-179.
    Does the built-in GPS have a fix, when you start your application?

    Hartti

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Re: Dev cert for JSR 179

    Quote Originally Posted by hartti View Post
    No, you do not need a special certificate to access the JSR-179.
    Does the built-in GPS have a fix, when you start your application?

    Hartti

    I am totally new to LBS. How to fix GPS?

    Thanks

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Dev cert for JSR 179

    If the "GPS has a fix" it means it "knows" where you are. If not, it means it is in the process of finding that out or is simply unable to do so (like if you are testing the application indoors and the satellite signal cannot reach you). There is nothing that you can fix, other than making sure that in the same location another reference application is able to "get a fix" and tell you the position.

    However, since you're mentioning the phone reboot there's a clear problem in your application and thus you should post this to the Java forum and get some assistance with the API usage.
    -- 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

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Re: Dev cert for JSR 179

    I got it working.

    I was using

    LocationProvider lp = LocationProvider.getInstance(c);

    // c = new criteria;

    lp was returning null.

    Then I used

    LocationProvider lp = LocationProvider.getInstance(null);

    and it is working fine now.

    Thanks,

Similar Threads

  1. Replies: 8
    Last Post: 2009-07-28, 03:38
  2. Dev cert
    By mshita in forum Symbian
    Replies: 17
    Last Post: 2008-06-20, 09:16
  3. developing MTM (manufacturer capabilities and dev cert)
    By ecostanza in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 2
    Last Post: 2008-04-29, 14:45
  4. MIDlet signing with Thawte cert for 6600
    By kersing in forum Mobile Java General
    Replies: 3
    Last Post: 2008-03-07, 05:41
  5. E61, CDC & JSR 179
    By jdesjean in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2007-06-27, 13:41

Posting Permissions

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