R
Roland
Hello
I am trying to find out the good provider for a kind of GPS program
written with j2me midp 2.0 using the location API (lapi.jar) and
Eclipse development environment with the plugin 'eclipseME'.
I have a very strange phenomena.
I try to create an instance of the Criteria class which is part of the
Location API (lapi.jar).
I can compile it without any problems, the program crashes at runtime.
My programm crashes with the following error line:
java.lang.NoClassDefFoundError: javax/microedition/location/Criteria
The lapi.jar is included in the project and the Criteria class exists.
Here is my code:
private LocationProvider FindProvider()
{
LocationProvider oProvider = null;
boolean bProviderFound = false;
int nDistance = 50;
while(!bProviderFound)
{
// set the distance
Criteria oCriteria = new Criteria();
oCriteria.setHorizontalAccuracy(nDistance);
oCriteria.setCostAllowed(false);
try { LocationProvider.getInstance(oCriteria); }
catch(Exception ex)
{
txtGPSData.setString("No provider available - please try
again");
return null;
}
if(oProvider != null)
bProviderFound = true;
}
return oProvider;
}
It crashes exactly where I instantiate the new Criteria object and for
some strange reasons the debugger of eclipse shows me the
Display.class?? But I use my textbox somewhere completely else in my
code.
Unfortunatly the eclipse debugger does not tell me any useful
error-message.
I am not a very good experienced java programmer (normaly doing C#)
and MIDP is quite new for me.
Any help would be very much appreciated. Thanks very much.
I am trying to find out the good provider for a kind of GPS program
written with j2me midp 2.0 using the location API (lapi.jar) and
Eclipse development environment with the plugin 'eclipseME'.
I have a very strange phenomena.
I try to create an instance of the Criteria class which is part of the
Location API (lapi.jar).
I can compile it without any problems, the program crashes at runtime.
My programm crashes with the following error line:
java.lang.NoClassDefFoundError: javax/microedition/location/Criteria
The lapi.jar is included in the project and the Criteria class exists.
Here is my code:
private LocationProvider FindProvider()
{
LocationProvider oProvider = null;
boolean bProviderFound = false;
int nDistance = 50;
while(!bProviderFound)
{
// set the distance
Criteria oCriteria = new Criteria();
oCriteria.setHorizontalAccuracy(nDistance);
oCriteria.setCostAllowed(false);
try { LocationProvider.getInstance(oCriteria); }
catch(Exception ex)
{
txtGPSData.setString("No provider available - please try
again");
return null;
}
if(oProvider != null)
bProviderFound = true;
}
return oProvider;
}
It crashes exactly where I instantiate the new Criteria object and for
some strange reasons the debugger of eclipse shows me the
Display.class?? But I use my textbox somewhere completely else in my
code.
Unfortunatly the eclipse debugger does not tell me any useful
error-message.
I am not a very good experienced java programmer (normaly doing C#)
and MIDP is quite new for me.
Any help would be very much appreciated. Thanks very much.