Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String destination = "London";
- final Landmark[] landmarks = Locator.geocode(destination.replace('n', ' '), null);
- Coordinates endPoint = landmarks[0].getQualifiedCoordinates();
- // Get a location provider.
- LocationProvider provider = LocationProvider.getInstance(null);
- if (provider == null)
- {
- throw new IllegalStateException("No LocationProvider Available!!");
- }
- // Try to fetch the current location and get the coordinates of the current location.
- Coordinates startPoint = provider.getLocation(-1).getQualifiedCoordinates();
- double destiinationlatitude = endPoint.getLatitude();
- double currentlatitude = startPoint.getLatitude();
- Criteria criteria = null;
- LocationProvider provider = null;
- javax.microedition.location.Location location = null;
- criteria = new Criteria();
- criteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_HIGH);
- criteria.setHorizontalAccuracy(50);
- criteria.setVerticalAccuracy(50);
- criteria.setCostAllowed(true);
- provider = LocationProvider.getInstance(criteria);
- location = provider.getLocation(5);
Add Comment
Please, Sign In to add comment