msupply-foundation / msupply-cold-chain

Android application for viewing and monitoring temperatures of fridges
GNU General Public License v3.0
3 stars 3 forks source link

266 qr code scanner #267

Closed mark-prins closed 10 months ago

mark-prins commented 10 months ago

Fixes #266

Adds a QR code scanning button to the server URL:

QRbutton

This opens a modal with the camera, and a button (top right) which closes the modal:

QRSCAN

If you scan a valid URL, such as this one:

image

Then the server URL is updated and you get a confirmation toast. If the QR code is not of a valid URL, such as this one:

barcode

Then the scanner closes and you get an error toast:

QRError

Wrt the QR scanner package: I tried a number of different packages. This one isn't the fullest featured or latest or most popular.. but it works. There were issues with dependencies with some, our outdated gradle version with others.. Most of them won't build with our application. With this one, I've been able to scan the small version of the omSupply QR reliably, so I'm happy with that.