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:
That's a great suggestion, and it would indeed remove the need for sideloading the APK altogether. I've reached out to the FairScan's maintainer regarding this and will keep this thread updated as I hear back.
Looks like we've received a lovely Christmas present from the FairScan's maintainer!
I'm happy to share that official integration for FairScan with ODK Collect is now live! With this release (FairScan v1.9.0), there's no longer any need to sideload a custom APK. FairScan can now be installed directly from the Google PlayStore and works seamlessly with ODK Collect out of the box!
I've attached a sample XLSForm below that works with this new official release: fileuploadtest.xlsx (8.4 KB)
I would also suggest checking out FairScan's GitHub repository and the updated README, which now documents this integration.
@ahblake - thanks again for the suggestion, much appreciated! @Faisal_Amani - it looks like you're using the Play Store version of FairScan (not the earlier custom APK). Please try the attached XLSForm above; it should start working for you right away.