Hi All,
I am developing LBS in Nokia C-3 using JSR 179, problem is that when i call location method, phone is searching for a bluetooth gps device, which i dont have so i end up not getting any location.
So i want to know , is there any way i can get the location from jsr 179 on Nokia s40 phone or C3 without invoking the bluetooth GPS? Here is my sample code:
Criteria crit = new Criteria();
crit.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);
LocationProvider p = LocationProvider.getInstance(crit);
if (p.getState() == LocationProvider.AVAILABLE) {
Location l = p.getLocation(25);
Coordinates c = l.getQualifiedCoordinates();
if (c != null) {
lat = Double.toString(c.getLatitude());
lon = Double.toString(c.getLongitude());
lat = setCoordinatelength(lat);
lon = setCoordinatelength(lon);
notFoundCount = 0;
Logger.log("Location found " + lat + ", " + lon);
return true;
} else {
system.out.println("Location Not Found");
return false;
}
}

Reply With Quote

