android如何实现相册时光轴?
ringa_lee
ringa_lee 2017-04-17 16:23:53
0
2
639

现在要实现扫描手机拍摄的所有照片,然后按照时间进行排序,实现时光轴效果,请问如何实现?

ringa_lee
ringa_lee

ringa_lee

reply all(2)
Peter_Zhu

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!