@@ -0,0 +1,2811 @@
+package com.cocoahero.android.essentials.media;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Date;%0A%0Aimport android.location.Location;%0Aimport android.location.LocationManager;%0A%0Apublic class ExifInterface extends android.media.ExifInterface %7B%0A%0A    // ------------------------------------------------------------------------%0A    // Constructors%0A    // ------------------------------------------------------------------------%0A%0A    public ExifInterface(File file) throws IOException %7B%0A        super(file.getAbsolutePath());%0A    %7D%0A%0A    // ------------------------------------------------------------------------%0A    // Public Methods%0A    // ------------------------------------------------------------------------%0A%0A    public Location getLocation() %7B%0A        float%5B%5D latlon = new float%5B2%5D;%0A        if (this.getLatLong(latlon)) %7B%0A            Location location = new Location(LocationManager.GPS_PROVIDER);%0A            location.setLatitude(latlon%5B0%5D);%0A            location.setLongitude(latlon%5B1%5D);%0A            return location;%0A        %7D%0A        return null;%0A    %7D%0A%0A    public void setLocation(Location location) %7B%0A        this.setLatitude(location.getLatitude());%0A        this.setLongitude(location.getLongitude());%0A%0A        if (location.hasAltitude()) %7B%0A            this.setAltitude(location.getAltitude());%0A        %7D%0A        %0A        Date date = new Date(location.getTime());%0A%0A        String dateStamp = new SimpleDateFormat(%22y:M:d%22).format(date);%0A        String timeStamp = new SimpleDateFormat(%22H:m:s%22).format(date);%0A%0A        this.setAttribute(TAG_GPS_DATESTAMP, dateStamp);%0A        this.setAttribute(TAG_GPS_TIMESTAMP, timeStamp);%0A    %7D%0A%0A    public void setAltitude(double altitude) %7B%0A        this.setAttribute(TAG_GPS_ALTITUDE_REF, (altitude %3E 0 ? %220%22 : %221%22));%0A        this.setAttribute(TAG_GPS_ALTITUDE, String.valueOf(Math.abs(altitude)));%0A    %7D%0A%0A    public void setLatitude(double latitude) %7B%0A        int latDeg = (int) Math.abs(latitude);%0A        int latMin = (int) Math.abs(((latitude %25 1) * 60));%0A        int latSec = (int) Math.abs(((((latitude %25 1) * 60) %25 1) * 60));%0A%0A        String latStr = String.format(%22%25d/1,%25d/1,%25d/1%22, latDeg, latMin, latSec);%0A%0A        this.setAttribute(TAG_GPS_LATITUDE, latStr);%0A        this.setAttribute(TAG_GPS_LATITUDE_REF, ((latitude %3E 0) ? %22N%22 : %22S%22));%0A    %7D%0A%0A    public void setLongitude(double longitude) %7B%0A        int lonDeg = (int) Math.abs(longitude);%0A        int lonMin = (int) Math.abs(((longitude %25 1) * 60));%0A        int lonSec = (int) Math.abs(((((longitude %25 1) * 60) %25 1) * 60));%0A%0A        String lonStr = String.format(%22%25d/1,%25d/1,%25d/1%22, lonDeg, lonMin, lonSec);%0A%0A        this.setAttribute(TAG_GPS_LONGITUDE, lonStr);%0A        this.setAttribute(TAG_GPS_LONGITUDE_REF, ((longitude %3E 0) ? %22E%22 : %22W%22));%0A    %7D%0A%7D%0A

Add helper class for working EXIF headers