hello i am developing an app but there are a few blocks missing such as start with and resulth.
could anyone assist me with the structure of the flow below so that
so i am having trouble from the Handle Scan Results as there are blocks missing
could help is anyone has a way around it
i've attached screenshot of the current blocks
HorizontalArrangement (for buttons)
Add 4 Button components inside:
"Examiners Mode"
"Fellows Mode"
"Graduates Mode"
"Admin Mode"
WebViewer (hidden, for API calls)
Notifier (to show messages)
QR Scanning Functionality
Add Barcode Scanner
when ExaminersMode.Click
call BarcodeScanner1.DoScan
when FellowsMode.Click
call BarcodeScanner1.DoScan
when GraduatesMode.Click
call BarcodeScanner1.DoScan
Handle Scan Results
when BarcodeScanner1.AfterScan [result]
if result = "" then
call Notifier1.ShowAlert [message "Scan cancelled"]
else
if starts with result "EXM" then
call WebViewer1.Url [https://your-google-script-url?action=scan&qrData=" & result & "&sheetName=Examiners"]
else if starts with result "FEX" then
call WebViewer1.Url [https://your-google-script-url?action=scan&qrData=" & result & "&sheetName=Fellows"]
else if starts with result "GS" then
call WebViewer1.Url [https://your-google-script-url?action=scan&qrData=" & result & "&sheetName=Graduates"]
else
call Notifier1.ShowAlert [message "Invalid QR code"]
end if
end if
Connect to Google Sheets
- WebViewer Setup
The WebViewer will communicate with your Google Apps Script web app. - Handle Responses
Add a WebViewer.GotText event:
when WebViewer1.GotText [response]
if response = "not_found" then
call Notifier1.ShowAlert [message "Person not found"]
else
set ScanResultLabel.Text to response
end if
Admin Features
Admin Screen
Create a new screen called AdminScreen with:
Password input field
"Generate QR Codes" button
"View Data" button
Admin Password Check
when AdminMode.Click
call Notifier1.ShowTextInput [message "Enter admin password:"]
when Notifier1.AfterTextInput [response]
if response = "admin123" then
open screen AdminScreen
else
call Notifier1.ShowAlert [message "Wrong password"]
end if
Printing Functionality
Since MIT App Inventor can't directly control thermal printers, there are two options:
Option 1: Use a Bluetooth Printer App
Install a printing app like "Printooth" on your Android device
Send data to it via Intent:
when PrintButton.Click
launch activity "com.printooth.app" with data uri ("data:text/plain," & ScanResultLabel.Text)