Save location to image information

Asked

Viewed 27 times

0

I need to take a photo and save it to the gallery and then send it to the database. However, I wanted to know how to save the coordinates along with the image information. Remembering that I can already get my location, I just can’t save it on the information in the image.

private File createImageFile() throws IOException {
    // Create an image file name
    String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
    String imageFileName = JPEG_FILE_PREFIX + timeStamp + "_";
    File albumF = getAlbumDir();
    File imageF = File.createTempFile(imageFileName, JPEG_FILE_SUFFIX, albumF);
    return imageF;
}

In the above code I am setting name, format and folder.

  • In your bank, do you have the columns to receive the longitude latitude for each image?! That your bank is external or internal?

  • I have an internal bank that saves the path of photo, longitude, and latitude, that information sent to the external bank. However, I would have to select the image to show in an Imageview and take Lon and lat for this image, but I couldn’t. I found the following way to get this inf from the image, but I’m having to fix this information or editing the image and placing the location.

  • Exifinterface Exif = new Exifinterface(imgPath); latitude = Exif.getattribute(Exifinterface.TAG_GPS_LATITUDE); longitude = Exif.getattribute(Exifinterface.TAG_GPS_LONGITUDE);

  • Dude, what’s your problem? Only with this code you can’t see much, it’s not very clear. Where’s the part you record in the bank? Little information on your question.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.