Remove previously taken images from gallery (via setting)

1. What is the general goal of the feature?

Remove photos taken for image questions from the device's image browser. At the moment, this can be done only upon submission. This means that if a user creates several draft survey instances, each with a photo, all previously taken photos are visible in the image browser.

This is a problem because 1) data privacy (photos are visible in various apps) and 2) users may accidentally link a previously taken photo to the wrong survey instance.

2. What are some example use cases for this feature?

  • As a coordinator for a large humanitarian NGO conducting beneficiary registration, I want to make sure my team members never accidentally use a photo in two different submissions while working on several drafts in order for us to avoid false records.

  • As the data privacy officer at my organization I want to make sure beneficiary ID photos are never visible in the camera roll / gallery of our local team's devices to avoid putting them and affected people at risk.

3. What can you contribute to making this feature a reality?

  • Funding :slight_smile:
  • UX flow, UI designs
  • User testing

I believe that @yanokwa and @Tino_Kreutzer have already discussed this privately but I wanted to give a public response so others who might be interested can chime in.

Is it ever desirable for pictures taken within the context of an ODK Collect form to be available from other applications? Using a setting has the advantage of leaving behavior the same for existing users but if it's never desirable it might make sense to change the default behavior.

Confusingly enough, there are different ways that media currently is made available outside of Collect:

  • Pre-migration away from /sdcard/odk, Android will identify all media files saved to the Collect instance folder and register them with the Android Media Store. This will go away after the migration is forced in v1.29.
  • Collect explicitly registers media files with the Android Media Store. I didn't realize this was the case and the comment says it's "so that the viewing is fast in Android 2.0+". It's not explicit but I'm guessing that the registration was done just for performance reasons and not because users wanted access to the files outside of Collect. I also imagine that either there's no longer a performance difference or even if there is it doesn't matter because devices are so much faster.
  • Collect launches a camera app on the device to take a picture. Some camera apps will only hand the media back to Collect but others will also save a copy in their own folder (e.g. a DCIM folder).

The second point is straightforward enough to take care of with or without a setting but the last one is much harder because camera apps are inconsistent in where they save images and how they name them. I'm not sure whether this is something most camera apps do or not (please comment if you know). It would be important to figure out whether doing something about that is necessary because that changes the scope a lot. To see whether your device does this, take a picture from Collect, then open an image browser/viewer app. On my Samsung Galaxy Tab A, for example, I see the image I just took twice. If I look at the image details, I see that one is in the ODK instance folder and the other is in the DCIM folder.