Execution problems when "programming"

My project can hardly be edited in the block editor. For example, moving components takes about 2 seconds. Changing from the designer to the block editor also takes about 10 seconds. Editing in the block editor is hardly possible. Where is the mistake ?

Hello Andy.

It could be any one of these reasons. We do not know relevant information from your size, so what I did is only guessing.

  1. You are not using the right browser. The recommendations are Chrome or Firefox using the latest version. It is also suggested to work on a computer, not on a tablet or phone.

  2. Your project is very large. How many blocks do you have? What about components? To find the size of a project, export it into AIA format and view the size of it. I recommend you stay under 10 MB if you want no (or few) lags, but the maximum size is 30 MB for a project.

and are you connectting with AI companion or not?

...also, ensure App Inventor is the 'King' of your Browser and of your broadband. If you are running other demanding websites in your Browser that can affect App Inventor. If you are at home and a member of the family is gaming online or watching a movie....... that could have a detrimental effect. It may be that your broadband supplier has an issue they are not aware of - use an online broadband test.

You can 'collapse' Blocks that you are not working on, so there are effectively less graphics to be rendered by your computer.

If your code is 'a lot' of Blocks, look at optimizing by using expedient Blocks from the 'Any Component' draw combined with Block Lists. You can find plenty of examples with a search of this forum.

Thanks for the information so far. I use Edge as a browser. However, this has been the case for some far larger projects. The previous size of the AIA is not even 1MB. The internet connection is 100 Mbit. So the error must be somewhere else.

When you have too many blocks spread out over too large a surface area,
the Blocks Editor hits a complexity limit when it tries to generate a blocks.png file for the screen.

There are two main approaches to deal with this:

  • Start a Google Doc with a Table of Contents explaining your app, with sections for Design, Data, Code, including Downloaded Png images of all Events, Procedures, Globals, and with html cross-links for easy navigation. Such a doc becomes easier to read than a complete blocks image, because you have FIND, Next, PREV, back functionality, and you can add paragraphs of commentary around your code. This is my preferred life saver when doing a very large complex app. If you go this route, try to arrange your blocks geographically in a column matching the order of your Table of Contents, then do periodic Clean Up Blocks to pull them inline. This sometimes lowers the load on the Blocks Editor.
  • Reduce your block count:
    • Use parametrized procedures for common code
    • Use Media text files instead of big clumps of text blocks
    • Use generic blocks instead of repeating component event blocks
    • Encode repeating decision patterns into lookup tables loaded from Media csv text files (does your blocks image look like a box of combs?)
1 Like

Edge is not an Approved Browser. You might put tyres on your car wheels that are not approved and they might generally work fine - but if you hit a patch of black ice you could crash.

Use Firefox or Chrome.

Sorry, nothing changes with Chrome either. Which doesn't surprise me, however.

Generally with large block workspaces Firefox tends to perform better than Chrome.