Source:
<code>private String getExifInformation() throws IOException { if (preloadBackgroundImageFile == null){ return ""; } String exifDate =""; String exifTime = ""; String exifCity = ""; String exifCountry = ""; ExifInterface exif = new ExifInterface(preloadBackgroundImageFile); <START> if (exif.getAttribute(ExifInterface.TAG_DATETIME) != null) { String[] exifDateTime = exif.getAttribute(ExifInterface.TAG_DATETIME).split(" "); String[] exifDateSplit = exifDateTime[0].split(":"); exifDate = exifDateSplit[2] + "." + exifDateSplit[1] + "." + exifDateSplit[0]; exifTime = exifDateTime[1]; } if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) != null && exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE) != null) { <END> String[] separatedLat = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE).split(","); String[] separatedLong = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE).split(","); Geocoder geocoder = new Geocoder(mContext, Locale.getDefault()); try { List<Address> addresslist = geocoder.getFromLocation(convertGPS(separatedLat), convertGPS(separatedLong), 1); if (addresslist != null && addresslist.size() > 0) { exifCity = addresslist.get(0).getLocality(); exifCountry = addresslist.get(0).getCountryName(); } } catch (IOException e) { Log.e(TAG, "connect to geocoder failed"+ "\nGPS_LATITUDE = "+ convertGPS(separatedLat)+ "\nGPS_LONGITUDE = "+ convertGPS(separatedLong) , e); } } return exifDate+"\n"+exifTime+"\n"+exifCity+"\n"+exifCountry; }</code><technical_language>suggestion String datetime = exif.getAttribute(ExifInterface.TAG_DATETIME); if (datetime != null) { String[] exifDateTime = datetime.split(" "); [...] } Ideally settings.dateformat settings.getFullTimeFormat format date time</technical_language>

Target:
private String getExifInformation() throws IOException { if (preloadBackgroundImageFile == null){ return ""; } String exifDate =""; String exifTime = ""; String exifCity = ""; String exifCountry = ""; ExifInterface exif = new ExifInterface(preloadBackgroundImageFile); String DateTimeExif = exif.getAttribute(ExifInterface.TAG_DATETIME); if (DateTimeExif != null) { String[] exifDateTime = DateTimeExif.split(" "); String[] exifDateSplit = exifDateTime[0].split(":"); exifDate = exifDateSplit[2] + "." + exifDateSplit[1] + "." + exifDateSplit[0]; exifTime = exifDateTime[1]; } String separatedLatExif = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE); String separatedLongExif = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE); if (separatedLatExif != null && separatedLongExif != null) { String[] separatedLat =separatedLatExif.split(","); String[] separatedLong = separatedLongExif.split(","); Geocoder geocoder = new Geocoder(mContext, Locale.getDefault()); try { List<Address> addresslist = geocoder.getFromLocation(convertArcMinToDegrees (separatedLat), convertArcMinToDegrees (separatedLong), 1); if (addresslist != null && addresslist.size() > 0) { Address address = addresslist.get(0); exifCity = address.getLocality(); exifCountry = address.getCountryName(); } } catch (IOException e) { Log.e(TAG, "connect to geocoder failed"+ "\nGPS_LATITUDE = "+ convertArcMinToDegrees (separatedLat)+ "\nGPS_LONGITUDE = "+ convertArcMinToDegrees (separatedLong) , e); } } return exifDate+"\n"+exifTime+"\n"+exifCity+"\n"+exifCountry; }