Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void setExifData(String children) {
- // Creating a temporary directory to store the images from SDcard.
- dataFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/temporary"); // Pass getFilesDir() and "MyFile" to read file
- try {
- String dataPath = dataFile.getAbsolutePath() + "/" + children;
- Log.i("inform","datapath is: " + dataPath);
- exifData = new ExifInterface(dataPath);
- } catch (IOException ioE) {
- Log.e("Error", "get path error: " + ioE.getMessage());
- }
- Log.i("inform", "setting attributs" + Double.toString(getLongitude()) );
- exifData.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, Double.toString(getLongitude()));
- exifData.setAttribute(ExifInterface.TAG_GPS_LATITUDE, Double.toString(getLatitude()));
- exifData.setAttribute(ExifInterface.TAG_GPS_ALTITUDE, Double.toString(getAltitude()));
- exifData.setAttribute(ExifInterface.TAG_ARTIST, Double.toString(getUserID()));
- exifData.setAttribute(ExifInterface.TAG_USER_COMMENT,
- "{" +
- "\"UltrasoundHeight\":" + Double.toString(getuHeight()) +
- "\"Direction\":" + Double.toString(getDirection())+
- ",\"Batteri\":" + Double.toString(getBattery()) +
- ",\"maxSpeed\":" + Double.toString(getMaxSpeed()) +
- ",\"Distance\":" + Double.toString(getDistance()) +
- ",\"CameraAngle\":" + Double.toString(getCameraAngle()) +
- "}");
- try {
- exifData.saveAttributes();
- } catch (IOException ioE) {
- Log.e("Error", "could not save Attributes" + ioE.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement