Note that there are some explanatory texts on larger screens.

plurals
  1. POCant set Date Taken/DateTime tag using the ExifInterface in Android
    primarykey
    data
    text
    <p>I've researched and tried numerous options to try and get this to work, but am not getting anywhere with this unfortunately.</p> <p>What I am trying to do is set the Date Taken tag (Tag_DateTime) in a JPEG's Exif data from within an Android app. I already have working code to set the Latitude and Longitute tags, but cannot for the life of me get the Date taken tag to set.</p> <p>Here is the code:</p> <pre><code>SimpleDateFormat fmt_Exif = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss"); try { ExifInterface exif = new ExifInterface(filePhoto.getPath()); // Set and save the GPS and time data exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE, strLat); exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, strLong); exif.setAttribute(ExifInterface.TAG_DATETIME, fmt_Exif.format(locLatestLocation.getTime())); exif.saveAttributes(); } catch (IOException e) { e.printStackTrace(); } </code></pre> <ul> <li>locLatestLocation - Location being used to get the time in milliseconds.</li> <li>fmt_Exif - SimpleDateFormat used to format the millisecond time into the correct format for the TAG_DateTime Exif tag.</li> <li>strLat &amp; strLong - Populated elsewhere in the correct format to set the Latitude and Longitude tags.</li> </ul> <p>I read in a post somewhere that the tag needs to be written in the milliseconds format, so have tried this too to no avail. In order to confirm my formatting with what is actually stored, I read and outputted the unformatted tag from a jpeg file which has the Date Taken tag, but the output is in exactly the same format as what I am writing to the tag and its still not working.</p> <p>It might also be worth mentioning that I have looking into the Sanselan class to do this, and due to the complexity and lack of examples would much rather try and get my existing solution working before changing to a completely different one.</p> <p>Has anyone managed to do this and if so what am I doing wrong??</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload