i think your trigger is scanning the qr code first.
you can find here in forum example for extern reader apps (via ABZing lib) or build in barcode scanner librarys.
then u make a get request (url with id) with okhttputils2 library.
u can catch that request via php if u have a web server and return the file, or making a non ui java server app with jServer library in b4j.
Dim Job As HttpJob
Job.Initialize("Job1",Me)
Job.Username="abc"
Job.Password="123"
Job.Download("https://api.yourdomain.com/api?getfile=" & ID)
see also wait for example ..
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1"
Log(Job.GetString) '<- answer from web server
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
usage ABZing lib (+ a Public Scan App from Google Store) in an Activity
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
'https://www.b4x.com/android/forum/threads/abzxing-barcode-reader.7303/#content
Private myABBarcode As ABZxing 'muss man erst kaufen dann kann man ein Zip runter laden, die Lib nutzt die App aus dem Play Store ..
Private ButtonScan As Button
Private EditTextBC As EditText
Private LabelFormat As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Scan")
EditTextBC.Text="..."
LabelFormat.Text = "..."
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ButtonScan_Click
EditTextBC.Text = "..."
LabelFormat.Text = "..."
myABBarcode.ABGetBarcode("myABBarcode", "")
End Sub
Sub myABBarcode_BarcodeFound(barCode As String, formatName As String)
Main.ScannedBarcode = barCode
EditTextBC.Text = barCode
LabelFormat.Text = formatName
End Sub
Sub myABBarcode_Canceled
Main.ScannedBarcode = ""
EditTextBC.Text = "Canceled"
EditTextBC.Enabled=True
LabelFormat.Text = ""
End Sub
Sub EditTextBC_EnterPressed
Main.ScannedBarcode = EditTextBC.Text.Trim
LabelFormat.Text = "OK"
End Sub