我用這個代碼,以獲取有關SD卡圖像信息的位置,ExifInterface拿到照片
File file = (File) iterator.next();
ExifInterface exif = new ExifInterface(file.getAbsolutePath());
String Date_Time = getExifTag(exif, ExifInterface.TAG_DATETIME);
String Flash = getExifTag(exif, ExifInterface.TAG_FLASH);
String Focal_Length = getExifTag(exif, ExifInterface.TAG_FOCAL_LENGTH) ;
String GPS_Datestamp = getExifTag(exif, ExifInterface.TAG_FLASH);
String GPS_Latitude = getExifTag(exif, ExifInterface.TAG_GPS_LATITUDE);
String GPS_Latitude_Ref = getExifTag(exif, ExifInterface.TAG_GPS_LATITUDE_REF);
String GPS_Longitude = getExifTag(exif, ExifInterface.TAG_GPS_LONGITUDE);
String GPS_Longitude_Ref = getExifTag(exif, ExifInterface.TAG_GPS_LONGITUDE_REF);
String GPS_Processing_Method = getExifTag(exif, ExifInterface.TAG_GPS_PROCESSING_METHOD);
String GPS_Timestamp = getExifTag(exif, ExifInterface.TAG_GPS_TIMESTAMP) ;
String Image_Length = getExifTag(exif, ExifInterface.TAG_IMAGE_LENGTH);
String Image_Width = getExifTag(exif, ExifInterface.TAG_IMAGE_WIDTH) ;
String Camera_Make = getExifTag(exif, ExifInterface.TAG_MAKE);
String Camera_Model = getExifTag(exif, ExifInterface.TAG_MODEL);
String Camera_Orientation = getExifTag(exif, ExifInterface.TAG_ORIENTATION);
String Camera_White_Balance = getExifTag(exif, ExifInterface.TAG_WHITE_BALANCE);
但GPS_Longitude,GPS_Latitude返回null?
當位置服務ON時,我捕獲了新照片,但仍返回null。
它顯示在畫廊應用程序內的文件屬性? –
不,大部分物品成立,但GPS位置我沒有找到它。 –