Loop problem in the QR code scanner screen

Do in Screen4 the same thing you do in Screen3 when Back is pressed (close screen).

Still the same. Same error happens and without getting results in a 2 or 4 seconds gets back to the screen 3 . If I press back one or two times I get the results but for a second then loop begins and If I do or press nothing, again and again opens screen 3 in an infinite loop.
What is the matter I do not get but I assume that there is a problem with either "WebViewer Component" or "Barcode Scanner" Sensor. Maybe I mistyped something but I don't get exactly what to do in this situation.
Please help me with this if you can, I will appreciate it.

When you open/close Screens, there is some timing lag. Have you tried virtual screens?

Hi @SteveJG thanks explaining about Timing lag. I didn't knew about "Virtual Screens" but I Searched about them and learn some step I think. But after removing Screen4 and adding a "virtual screen" in my screen 3. (I have now 2 screens, splash is 1 and second main screen is 3).
I get a warning massage that "Error 1501: Your device does not have a scanning application installed." when testing in AI COMPANION
I know I must've done something wrong in "virtual Screen" part or implementing the 2 buttons in a Screen and etc.. but this is what I came up.
If you help me to solve this even testing will be appreciated alot.

Thanks in advance.

This is my block and designer structure :

this is my main screen in AI COMPANION looks like:

We have to see the full picture ...

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.

export_and_upload_aia

.

Thanks for your help @ABG & @SteveJG .this is my .aia project and all of the files within that.
thank you all very much again for your help.



qr3
QRCode_Scanner_copy.aia (214.8 KB)

barcode
un-checking UseExternalScanner should eliminate the error.
bctest

as a test I added a label to see what has been scanned because I do not scan a QR that points to a URL. The scanner works on my Android 13.

Nice graphics. :wink:

Set WebViewer to 50% height in it's Properties; then scan the attached


QR code and your app points to a url.and displays the page if you scroll after scanning. You need to tidy this up a bit to do exactly what you want. Experiment,

1 Like

Thanks again for your efforts and very helpful guidance Dear @SteveJG .
But with all due respect, Again when I run the app in AI COMPANION (it needs adjustments as you mentioned above in WebViewer) and works fine, but when testing in MY Android 9.0 device or LDPLAYER simulator both gets me the same loop cycle of the same page.

this is the video of running the app in my device and the so called screen reset problem.

problem of the looping still remains even after all the tests.
Main problem is that screen loops back again and always resets itself. I don't know maybe I have some compatibility issues in my device or something else that I do not know yet but I still want to try different methods cause I want to solve this somehow, In the meantime I will be appreciate if you have any suggestions or any kind of help or etc..

I notice in Screen1 you don't turn off the Clock before opening Screen3.

That can cause problems.
Screen1 blocks

P.S. I can't vouch for anything with extensions in it. Ask the author, in the place you got them.

1 Like

I also notice in Screen3 the Arrangements are empty.
(No indentation, so they don't hide anything but themselves.)

If all your components are set to Automatic, they will fight for screen real estate at run time depending on what's in them.

What were you expecting Button2 to do for you?

I see your Sizing is Responsive, a useful default.

However in Screen3 Button2 gets 90 pixels vertically, which might be a different portion of the screen on devices with different resolutions.

For tighter control of appearances, use per centages for Responsive Design.

P.S.. You use a lot of fancy effects.
I don't do fancy.

@ABG thanks about the "clock on/off" and extension topic.
I will use a static picture as splash.
but for button 2 , I did not know that I used a correct block structure and shared it with you for guidance and correction if necessary.

After these things that you informed me, I want to remove the "virtual screen" part and rebuild the whole screens without the extension or else and try to open the result of the scanning processes in another screen to check the results.

For button2, the blocks are okay, but the Designer structure is not okay.

Arrangements are meant to act as containers for other components, so they can all be made visible or not as a group.

Perhaps you missed the lesson where the mock components can be dragged around in and out of arrangements?

P.S. An example of Arrangements usage:

Dear @ABG I'm so grateful for your time and effort in helping me with this. Thank you very much. I will read the example and try the instructions above :pray:

Switching Screens is more disruptive than hiding content in a single screen, especially for a small app like this.

You can rename the enclosing Arrangements and components to help you (and hopefully us English readers) identify what each component is and its purpose (like ButtonScan)

1 Like

First of all, I would like to thank you again for your valuable lessons that you taught me during this topic and then inform you that the solution to the problem, was the clock timer ON selection from the beginning. I simply turned it off as you stated earlier and the problem solved.

But for the explanation you provided in the above section, what would you suggest me to do? Or rather, what is the most suitable method?
1.use virtual screens or
2.Use another screen to show the scan results?
In my case, I was told to show the results in another screen, but if you care to give me a last advice in this matter, what would it be ?

Depends on who is doing the telling.

Are they paying you or grading you?
If so, give them what they paid for.

Otherwise, do what is best for you, whether it is a learning experience or less aggravation down the road.

1 Like

1 - here is a version of your app using a single Screen.

QRCode_Scanner_copy_copy.aia (213.6 KB)

2 - if displaying on a separate Screen is a project requirement then use another Screen for the results. You could discuss it with who ever told you to do that (perhaps it was only a suggestion). Both displaying the url on another Screen or on the same screen work well.

Whether a separate display Screen is appropriate or not depends on what the app user will do with the displayed web page later.

Good luck with your Project Ali.

2 Likes

Dear @SteveJG Thanks for your great work. I also solved the problem with the help of @ABG but your file has a great learning opportunity and I am most grateful to you for doing this. I will gonna use it for learning the effective and correct way of implementing Virtual Screens in a Single Page and in the end, modify it for my own needs.
By the way using another screen for results was a suggestion from a friend.
Thank you for everything and Be safe.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.