Explicit intent for printing barcodes

TLDR; Does anyone know where in the Android Studios file structure I can access the module that will allow me to insert an explicit intent for printing the barcode?

I am a masters student i Norway working on the use of barcode printing and scanning to pull up a patient’s journal in ICHIS, the DHIS2 installation in Malawi.

We have a working pilot, but it involves downloading a local copy of the barcode and printing it from local storage. The next object is to create a cleaner user experience to print the barcodes with less clicks for the user. I am hoping to do that with implementing either an explicit intent or an implicit intent in the code. By that I mean that when the barcode is generated within the Person Registry, I’d like there to be a print button that either directly launches the printer app and exports the barcode to the printer app, or launches an apps drawer with compatible apps.

(The reason why I want to use intent and not simply using the PrintHelper is that the printers we are using are not always recognized as printers by the device.)

I have got my own fork of the ICHIS code, but I am unable to find out where in the code this is set. I’m assuming the file structure in ICHIS is mostly the same as in all DHIS2 apps. Can anyone point me in the right direction?

Also, I’m sorry if this is the wrong forum for this question.

Hi @Alina, welcome to the community!
I didn’t check ICHIS code but if it is a fork of the Android Capture app, the location should be similar.
I assume that you are talking about when you are using a data element as Barcode like this, right?:

This Barcode dialog is implemented in a class called QRDetailBottomDialog.kt.
I hope this will help you, let us know if you have any doubt!.

1 Like