Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect that Android Camera Geo tagging setting is on/off (GPS Info in the EXIF data)

I'm trying to find out if there's a way to detect the "geotag" or "store-location" setting of the camera on an Android device. I don't mean the general location access setting which I'm very familiar with, but the more "hidden" setting when you use the camera.

Most users are not even aware it exists, and it's turned off by default, I would like to be able to tell the users that this setting is off so that they can turn it on if they want to, this way pictures will have all the EXIF data concerning their location.

I hope this has not been answered before on so, if its the case, I'm sorry about it and would you please link me to the right thread.

like image 748
Julz Avatar asked Mar 18 '13 14:03

Julz


2 Answers

Each Android device usually ships with its own custom camera app, made by the manufacturer of that device. Each has their own UI and probably own way/place to store this setting, if it even exists for that device. So any answer to this question would be heavily device-dependent.

But even if you just restrict yourself to the AOSP camera app, which is the app used on the Nexus devices, there's no API for this. The app asks if you want to enable GPS tagging the first time the app is run, and after that the option to enable/disable geotagging can be found in the settings.

There's no way to confirm if that setting is on, since it's not part of any public or standard Android API. You might be able to do something with the accessibility API to read these settings, but it requires substantial permissions to do so (Accessibility service documentation here).

like image 87
Eddy Talvala Avatar answered Sep 22 '22 18:09

Eddy Talvala


To extract the EXIF information from the files, you could consider an example similar to the updateExif example shown in this code snippet. This would enable you to get all the information including make, flash, focal length etc which is stored in the EXIF file.

like image 28
Ganesh Avatar answered Sep 25 '22 18:09

Ganesh