From my application I can open gallery. Is there any way to get latitude and longitude of any selected image in gallery to my application?
the exif.getLatLong(float[])
is now deprecated, you can use a better method which returns a double[]
:
ExifInterface exifInterface = new ExifInterface(file);
double[] latlng = exifInterface.getLatLong();
if (latlng != null) {
Double currentLatitude = latlng[0];
Double currentLongitude = latlng[1];
Log.d("Debug", "Exif : latitude: " + currentLatitude + ", longitude: " + currentLongitude)
}
Happy coding.