External app with intent

I found a QR scanner, but I am not able to get it work for the intent.

This app's GitHub documentation only mentioned the "org.idpass.smartscanner.odk.QRCODE_SCAN".

In my ODK form, I have placed the code "ex:org.idpass.smartscanner.odk.QRCODE_SCAN" in appearance. But, I failed to get the output after scanning.

I need help here, what am I missing?

Hi @chun_hing_yap

There is a barcode widget that you can use https://docs.getodk.org/form-question-types/#barcode-widget
or maybe you need to use that particular scanner?

I knew odk has its native barcode scanner but I want to learn how to use this external app because it has other features such as NFC feature as well. At the very basic, I want to know how it returns the value after QR scan from ODK intent.

I just downloaded the app and have the intent in the appearance. The form able to call the intent, however I didn't get the output after scan.

I believe this app is built with odk intent and it shall be quite easy to use. I wonder what I am missing.

Can you take a look and how it can be used on ODK? The info is provided previously.

I need to take a closer look to check if this app can be used by ODK Collect. They mention ODK in a few places in the README file but I'm not sure if it stands for Open Data Kit or maybe something else. How did you find that app? Are you sure it is supposed to work with ODK Collect?

I took a quick look and it looks like there are multiple values returned: https://github.com/newlogic/smartscanner-core/wiki/Result-fields-reference. I believe it follows the approach documented at https://docs.getodk.org/launch-apps-from-collect/#external-apps-to-populate-multiple-fields. In your form, you would need to create a field-list with field names that match the documented return value names for the ones you want to capture.

@LN is right it works with https://docs.getodk.org/launch-apps-from-collect/#external-apps-to-populate-multiple-fields
Here is a sample form you can use to scan a barcode according to https://github.com/newlogic/smartscanner-core/wiki/Result-fields-reference#barcoderesult
scan.xlsx (4.9 KB)

1 Like

can you also share the barcode?
Does the barcode need to encode:

I used a sample barcode from the internet. It was this one:

value for sure it's basically the number it represents (1234567890128 if you use the attached barcode)

other elements are:

corners (string) : 4 corner points of the overall barcode being scanned
imagePath (string) : Image path of the barcode successfully captured
image (string) : Image in Base64 string of the barcode successfully captured

and they are not encoded in the barcode.

As far as I can tell this app is designed for use with passports and the intents pull in data specific to passports. I suppose it would take a bit of re-coding to make it more generally useful as an interface between ODK and general purpose barcodes, NFCs and MRZs

I’m particularly interested in the use of the NFC stuff and it seems like the Wakdev NFC Tools pro app (£2.99) can handle read and write of NFCs and has an API.

I’m not technically minded enough to figure out what we’d need to put in an ODK form to grab data from an NFC

docs are here

I’m sure this is really simple if the styling of the intents is compatible with ODK

Thank you. I have tested the barcode. It works.

I think the external app need to be customized to return the values encoded in NFC, just like how the ID PASS SmartScanner did.

You can check the code as follows:

I am not expert on the programming but I believe the simple api you shared might not enough to do it.

I have tested the barcode and qrcode of ID PASS SmartScanner. It will simply return a text string to a single field. However, I couldn't get the qr_code_json_value for QR scan works. Initially, I thought it will read a json string and process the key:value pairs and parse in to the ODK form with field named exactly the same as keys.

Perhaps, I mis-understanding how this should work, I never get returns for qr_code_json_value after a few QR scan tries.