1. Simply sort by the modification time of the photo files, file.lastModified()get the last modification time of the file, and then compare; 2. Accurately obtain the time, the photos have EXIF information, which includes the photo shooting time, location coordinates, aperture, Equipment, etc., time acquisition example
ExifInterface exif = new ExifInterface(path);
String date = exif.getAttribute(ExifInterface.TAG_DATETIME);
For more information, just pass different TAGs. Please refer to the ExifInterface TAG definition for details.
Some photos do not have exif information, and reading from exif is not complete enough Read the last modification time of the file directly from the database
1. Simply sort by the modification time of the photo files,
file.lastModified()
get the last modification time of the file, and then compare;2. Accurately obtain the time, the photos have EXIF information, which includes the photo shooting time, location coordinates, aperture, Equipment, etc., time acquisition example
For more information, just pass different TAGs. Please refer to the ExifInterface TAG definition for details.
Some photos do not have exif information, and reading from exif is not complete enough
Read the last modification time of the file directly from the database