Is it possible to get sub-second image capture time with ACTION_IMAGE_CAPTURE?
I am trying to take a photo using ACTION_IMAGE_CAPTURE and I want to correlate accelerometer and gyroscope data with the image, so I need the image capture time with sub-second resolution for reliable results. I can get the capture time from the Exif data, but it does not provide sub-second resolution. Is there any way to obtain this other than writing a custom camera application?
Perhaps. There are hundreds, if not thousands, of camera apps for Android, both pre-installed and installed by users from places like the Play Store. Any of them could be chosen by the user to handle your ACTION_IMAGE_CAPTURE request. Whether they set EXIF headers or not is up to the developers of the camera app. There is no requirement that a camera app set the particular EXIF header that you are seeking.
Is there any way to obtain this other than writing a custom camera application?
Actually, since you are invoking the capture activity from within your app, you have ability to capture the exact time with sub seconds by just capturing the current time from within the onActivityResult callback. This is very close to when the photo is captured by the camera driver, it will at least give you a date with milliseconds.
Asked in February 2016Viewed 3,877 timesVoted 6Answered 2 times