How to follow the flow of the executed code?
Let me explain better, when the blocks are a large number, it is really difficult to understand where there is an error that leads the app to perform something different than desired
In many programming environments there is the possibility of executing the step-by-step code, for example in the Visual Studio environment the function keys F10 and F11
How to do with App Inventor to understand what instructions have been performed since the app launch so far?
http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/other/testing.html
No Step function, but you can build one into your blocks - outputs or break points.
I can build one?
How?
Only with ‘do it’ is very hard to debug an app
You can build your own logging facility and log important events or values.
or
logger_to_list.aia (2.6 KB)
…That’s a really nice example ABG.
Thanks for the indication to visualize the flow of code by writing on a special textbox, a method that I already knew and used
The second example, the one with the listboxes is really nice
But this system is not enough, at least in large projects, for two reasons:
1- occupies screen space for viewing events, and this space may not be available
2- wanting to monitor the instructions executed, it would be necessary to insert an update of the textbox monitor for each blocks instruction, with a significant slowdown of the code, an at least double memory consumption of the app compared to the program code, and a commitment to writing at least double
Have you tried using the “Do It” feature?
Edit: Nevermind, I just saw your post regarding this feature.
Yes, I know and use the do-it function
But you try to use it on a cycle that is repeated (such as updating the data received by the GPS every second), and you will see that it is not of great use, because when you see it, the value can be already changed
I’m looking for information on debugging using adb to understand if it is possible to have a trace of the code executed without interfering with the program display
Perhaps
Capturing Device Logs Using ADB
ADB is a command-line utility that that can be used to control your device over USB from a computer. It will allow you to install / uninstall and or view logs on your device. This could be very handy when there are issues with a specific app and you…
Reading time: 1 mins Likes: 7
A few small tips:
-
Check code constantly to be sure everything is working.
-
Look out for red X’s. Example: https://tinyurl.com/vhobyph
-
If possible, try to add all property values (example: height, images, background colors, etc.) via the blocks editor to keep everything in one place - to visually see everything that’s going on (nothing hiding).
-
Keep blocks organized in groups (To Do, Doing, Done & Done-sections organized by their duty in the app. Disable any blocks not actively being used. Example: https://tinyurl.com/qvgweng
@codo Please edit your answer and add screenshots directly into your post rather than linking to an external site. Thank you.
Taifun