×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    40

    Question Problem Location.

    Hello, I develope in NetBeans 6.9.1, I try to make a program for J2ME that get Location and I have this Error: "Error preverifying class", What does it mean?, and this is my code:

    class MyLocation extends Thread {
    private Am midlet;
    private String StrValue = "";
    //private LandmarkStore store = null;
    //private static final String STORENAME = "TOURIST_DEMO";

    public MyLocation(Am midlet) {
    this.midlet = midlet;
    }

    public String getStrValue() {
    return StrValue;
    }

    public void run() {
    try {
    GetPlace();
    } catch (Exception ex) {
    ex.printStackTrace();
    midlet.showMessage("Atencion!", ex.getMessage());
    //midlet.showMessage("Atención!", "Error loacalización.");
    }
    }

    private void GetPlace() throws Exception
    {
    try
    {
    GetLocation();
    } catch(Exception MyException){
    MyException.printStackTrace();
    midlet.showMessage("Atencion!", "Error: " + MyException.getMessage());
    //midlet.showMessage("Atención!", "Error loacalización.");
    }
    }

    private void GetLocation() throws Exception
    {
    try
    {
    Criteria cr= new Criteria();
    cr.setHorizontalAccuracy(500);
    // cr.setVerticalAccuracy(25);
    // cr.setPreferredResponseTime(Criteria.NO_REQUIREMENT);
    // cr.setPreferredPowerConsumption(Criteria.NO_REQUIREMENT);
    // cr.setCostAllowed(false);
    // cr.setSpeedAndCourseRequired(true);
    // cr.setAltitudeRequired(true);
    // cr.setAddressInfoRequired(true);
    // Get an instance of the provider
    LocationProvider lp= LocationProvider.getInstance(cr);
    // Request the location, setting a one-minute timeout
    Location l = lp.getLocation(160);
    Coordinates c = l.getQualifiedCoordinates();
    if (c != null) {
    double lat = c.getLatitude();
    double lon = c.getLongitude();
    String StrLat = c.convert(lat, 20);
    String StrLon = c.convert(lon, 20);
    String StrLocation = "Latitud: " + StrLat + " - Longitud:" + StrLon;
    StrValue = StrLocation;
    midlet.showMessage("Atencion!", StrValue);
    }
    else {
    midlet.showMessage("Atencion!", "No se puede loacalizar.");
    }
    } finally {
    //int x = 0;
    }//Try
    }
    }

    this is the import: import javax.microedition.location.*;

    I call this Class this way:

    MyLocation GetLocation = new MyLocation(this);
    GetLocation.start();
    showMessage("Atencion!", GetLocation.getStrValue());

    What's wrong with my code?.
    If somebody can help me, thanks in advance.

  2. #2
    Registered User
    Join Date
    Jan 2009
    Location
    Bangalore, India
    Posts
    116

    Re: Problem Location.

    Please Check CLDC version in your netBeans settings. It should be selected as CLDC 1.1.
    Thanks,
    Somendra

    http://in.linkedin.com/pub/somendra-singh/4/1a9/703

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    40

    Re: Problem Location.

    Thanks Somendra, you are right, now the error has gone.

Similar Threads

  1. Location namespace problem
    By Fillinger in forum [Archived] Qt Mobility Project
    Replies: 6
    Last Post: 2010-07-12, 15:06
  2. problem in getting location
    By mobio.dev in forum Symbian C++
    Replies: 1
    Last Post: 2010-03-07, 03:06
  3. Problem in Area location name
    By smrati_kulshrestha in forum Symbian C++
    Replies: 3
    Last Post: 2010-01-06, 11:00
  4. Problem in Getting Location.....
    By furqankamani in forum Symbian C++
    Replies: 2
    Last Post: 2009-06-11, 08:57
  5. Problem in knowling the location through C.B.S
    By honest_success in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2008-10-02, 11:52

Posting Permissions

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