Geocoder geoCoder = new Geocoder(getApplicationContext(), Locale.ENGLISH); try { List<Address> addresses = geoCoder.getFromLocationName("Mumbai" , 5); Toast.makeText(MainActivity.this,""+addresses.size() , Toast.SHORT).show(); if (addresses.size() >= 0) { GeoPoint p = new GeoPoint( (int) (addresses.get(0).getLatitude() * 1E6), (int) (addresses.get(0).getLongitude() * 1E6)); Log.d("Latitude is:", ""+ p.getLatitude()); Log.d("Longitude is:", ""+ p.getLongitude()); Toast.makeText(MainActivity.this,""+p.getLatitude(), Toast.SHORT).show(); } ...
int i = 0; for (GeoPoint p : track) { latitude = p.getLatitude(); longitude = p.getLongitude(); if (i == 0) {
List<Address> addresses; addresses = geocoder.getFromLocation(startPt.getLatitude(), startPt.getLongitude(), 1); String startPtStr = addresses.get(0).getAddressLine(0); addresses = geocoder.getFromLocation(endPt.getLatitude(), endPt.getLongitude(), 1); String endPtStr = addresses.get(0).getAddressLine(0);
GeoPoint loc = (GeoPoint) proj.fromPixels((int)e.getX(), (int)e.getY()); double longitude = loc.getLongitude(); double latitude = loc.getLatitude(); mLatitude = latitude; mLongitude = longitude;
float t = interpolator.getInterpolation((float) elapsed / duration); double lng = t * toPosition.getLongitude() + (1 - t) * startGeoPoint.getLongitude(); double lat = t * toPosition.getLatitude() + (1 - t) * startGeoPoint.getLatitude(); marker.setPosition(new GeoPoint(lat, lng)); if (t < 1.0) {