我使用Eclipse Blackberry SDK,我创建了一个Project LIBRARY,然后我需要通过POST将值传递给页面(例如:food.php),但是当我尝试创建Criteria实例时,程序会返回此消息“没有应用程序实例”,我很困惑,因为当我在BlackBerry Application中使用相同的代码时,不会发生这种情况
记住这是一个项目黑莓图书馆(无申请)
这是我的代码
double lng = 0.0;
double lat = 0.0;
try{
BlackBerryCriteria myCriteria = new BlackBerryCriteria();
//myCriteria.enableGeolocationWithGPS(BlackBerryCriteria.FASTEST_FIX_PREFERRED);
myCriteria.setMode(LocationInfo.GEOLOCATION_MODE);
BlackBerryLocationProvider myProvider = (BlackBerryLocationProvider)LocationProvider.getInstance(myCriteria);(HERE IS THE PROBLEM)
BlackBerryLocation myLocation;
myLocation = (BlackBerryLocation) myProvider.getLocation(60);
lat = myLocation.getQualifiedCoordinates().getLatitude();
lng = myLocation.getQualifiedCoordinates().getLongitude();
double alt = myLocation.getQualifiedCoordinates().getAltitude();
}
catch(Exception e){
System.out.println("ERRORRRR " + e.getMessage());
}