How to launch Open Camera and save/use captured image in ODK Collect on Android 11

1. What is the problem? Be very detailed.
Android 11 does not allow other camera apps as default camera

2. What app or server are you using and on what device and operating system? Include version numbers.
ODK Collect v2021.2.2 on Android 11

3. What you have you tried to fix the problem?
Reset app preferences

4. What steps can we take to reproduce the problem?
Take picture in ODK Collect on Android 11. And try to set OpenCamera as default camera

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
Android 11 does not prompt user to choose default camera app anymore. It automatically launches the built in camera app. Problem is, our project needs timestamped photos with the project title which we can set on Open Camera

Is this something you might do with a post-collection script? You could pull the image creation date from the metadata using ExifTool and then annotate the image using ImageMagick.

2 Likes

Hi, Dan.

Thank you for your suggestion. However, we visualize the data by connecting our BI tool directly to the Central server via OData so we can provide almost realtime data collection status and results. Post data collection process may delay our reporting.
But the idea you shared is very much appreciated.

Thanks and cheers,
Vinia

Could you use Lightweight timestamping to record when the image is taken and then in your BI add a text widget underneath the image that shows the relevant details from that form submission for that image?

2 Likes

Thank you. We can try that. But the images are usually viewed in gallery/album format. So I don't think this will work for us. But thanks, Dan! Sending you a screenshot in a private message to show you how we present in our dashboard. And why we need Open Camera to work in ODK Collect on Android 11 :smiley:

Cheers,
Vinia

Sorry, I'm not sure how to make that happen, and yeah Android 11 introduced changes that make it more challenging to use external apps.

1 Like

To be explicit, Android no longer allows changing default camera apps and this is not something ODK Collect has any control over.

Some options are:

  • train data collectors to open OpenCamera manually, take their picture, then attach it.
  • launch OpenCamera from a text question using the appropriate intent appearance. There won't be a return value and that's fine -- the goal is just to launch the app. In the next question, have data collectors pick the picture they took and attach it.
  • explore whether OpenCamera does or could set ClipData when returning to an app that launched it. If so, you can use the intent appearance on an image question type to launch the camera app and receive an image from it. Details here.
1 Like

Great! Thanks so much for your help, @danbjoseph and @LN!