Hello everyone! - Hope you're doing well! ![]()
I wanted to share a small exploration I recently worked on, hoping it might be helpful to someone!
The "What & Why?" / Problem Statement
Recently, I was looking for an open-source document scanner app that could:
- Use an Android phone's camera to scan documents,
- Automatically Crop or Enhance Images / Generate a PDF, and
- Attach that PDF directly to a specific ODK Collect form - ideally automatically because in practice, many data collectors struggle to remember which scanned file (or clicked image) belongs to which particular saved draft form. This often leads to incorrect attachments and, ultimately, incorrect submissions. Automating this hand-off felt like a meaningful improvement to me.
During my research, I came across this app: FairScan - a clean, respectful, open-source document scanner. While it worked well as a scanner, it didn't interact with ODK Collect in the way I was hoping it would (i.e., returning the scanned PDF back to ODK Collect automatically).
The "What I did?" / Solution
So, I experimented with making minimal changes to FairScan's codebase, using ODK Collect's documented intent-based integration, to allow the scanned PDF to be sent straight back to ODK Collect - and it worked exactly as intended! ![]()
For anyone interested in trying this out or exploring further, I'm including a demonstration, the GitHub repo for the minimal code I modified to make it work (contains built .apk files as well!), and a sample XLSForm below:
Quick Demonstration [50 seconds]:
GitHub Repo / Modified Source Code / Built .apk Files:
Sample XLSForm:
fileuploadtest.xlsx (8.3 KB)
That's all!
Have a great day!
- and, Merry Christmas in advance! ![]()