I read a QR code that can contain many characters. One of the examples I use is 630 characters. The information is 12 lines: the first with two control words and then 11 rows.
The rows are a CSV of 10 fields (each with data around 55 characters).
The process is as follows (a bit simplified):
v_ rows = value.split ([new_line]):
foreach (row in v_rows)
v_elements = row.split (";")
if (v_elements.length () = 10)
if (v_elements [a] = var_a and v_elements [b] = var_b)
call_procedure_to_put_or_refresh_values_if_not_in (app.variable_list, row)
flag_hay_que_guardar = true
local_storage.save (“variable_list”, app.variable_list)
Well, when I scan the QR code, the camera stays active for about 20 seconds until it returns to the screen and shows the information read.
When I enter the screen (once I have the information read and saved), it takes about 10 seconds to display the information.
Note: I have modified the procedure:
Now after reading the QR code I save it to a variable and set a timer (at 200 milliseconds).
When the timer fires, I stop the timer (so it won’t run again) and launch the function that processes the information.
Thus, the program does not stay on the screen to read the code (which is confusing and it seems that it has not read it correctly), but the process of saving and displaying the information has taken me 1 minute
I keep optimizing the code. Now, in app.variable_lista, instead of saving a list of CSV (string), I directly save a list of lists.
Now, after reading the QR code “only” it took me 55 seconds, but at least now when entering the data page “only” it takes 15 seconds (before I think it was 20)