Android Exif仅返回lat&;作为整数的lon

Android Exif仅返回lat&;作为整数的lon,android,exif,Android,Exif,我通过我的应用程序将图像上传到数据库。有了这些图像,我想用exif数据捕捉图像拍摄的位置。当我在手机上测试时,lat和lon确实上传了数据,但只上传到一个四舍五入的正数 当我期望的位置是Lat=52.4和lon=-1.9时,我实际上得到的是Lat=52和lon=1 这是我的密码;lat和lon都是字符串: ExifInterface exif = new ExifInterface(mainMenu.filename); lat = exif.getAttribute(ExifInter

我通过我的应用程序将图像上传到数据库。有了这些图像,我想用exif数据捕捉图像拍摄的位置。当我在手机上测试时,lat和lon确实上传了数据,但只上传到一个四舍五入的正数

当我期望的位置是Lat=52.4和lon=-1.9时,我实际上得到的是Lat=52和lon=1

这是我的密码;lat和lon都是字符串:

ExifInterface exif = new ExifInterface(mainMenu.filename);    
lat = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
lon = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
我保存lat和lon的数据库值是双倍的,我也尝试了浮动。

查看,您不应该使用该方法吗


那么,我该如何将“说lat”指定给我的字符串lat?我在某个地方误解了你;您的数据库值不是双倍还是浮动?你为什么需要绳子?不管怎么说,我真的不太懂java,但是你能不能只用
Float.toString(latLong[0])
float[] latLong = new float[2];
if (exif.getLatLong(latLong)) {
    // latLong[0] holds the Latitude value now.
    // latLong[1] holds the Longitude value now.
}
else {
    // Latitude and Longitude were not included in the Exif data.
}