General Tips and Tricks for App Inventor

This list was made by @Taifun

  1. Use different screens wisely
    Before starting to create another screen, first you should think about is it really necessary? See also Building apps with many screens and SteveJG's post about advantages/disadvantages, because in only one screen you also can use vertical arrangements to simulate different screens, just set the arrangements to visible = true/false as needed...
    If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while... The recommended method of switching screens in App Inventor

  2. App Inventor works best if you use images whose size matches the size you want them to appear on your screen. If you import larger images into your app, your app may run out of system memory. Using Images with App Inventor

    by @Italo
    First, you need to understand that the file size of an image is not the amount of memory it uses when it's being displayed. The file size is the compressed size, much like a zip or rar file. When viewed, the image needs to be decompressed.
    For example, if your image says its file size is 100 kb, and its dimensions are 1024 x 768, 32 bit color, then that image uses over 3 mb of RAM (not 100 kb!) when you show it on the screen. ((1024 * 768 ) * 32) / 8 = 3,145,728 kb (3 mb)

    Now, this is a mistake most people make when using arrangements as "virtual screens": They set different image components with their images loaded but hidden, instead of having only one image component and changing the picture according to the user's selection or app events, not knowing that apparently the hidden image components are also using the ram, (yes, even though they are invisible!).

  3. Avoid redundancy
    Probably it helps to read chapter 19 - 21 in Dave's book to get an idea how to do DRY programming with App Inventor - Don't repeat yourself

  4. See SteveJG's monster list of tips and tricks

  5. How to overcome the App Inventor project limit of 30 MB

  6. Backup your project frequently

How to make a global variable that can be accessed by all screens?
App crashing as screen changes
Changing the Order Of Screens/Changing Screen1
How to read a specific cell in google sheet by using App inventor then make it as a started value for Sreen 2?
Unable to switch screens!
I am trying to split 3 strings divided by spaces into 3 different Variables in a certain order, only it doesn't work. What am I doing wrong?
report this app in my mi mobile ? miui bug report
report this app in my mi mobile ? miui bug report
Controling player after switching screens
The application does not start
Notifier.AfterChoosing Error
My app keeps crashing down
Internal errors - app constantly freezes
Time Delay Not Working
TinyDB Problem how do i add a number from one screen to a different screen?
Can't delete screen
Error: Application has stopped
Open weburl in web component
App inventor not able to compile apk
Building Apps with many screens
Como hago para que tocando un boton me pase a otra pantalla una lista csv
View data from one screen to another with listview and TinyDB
App inventor cannot export my file it said my file are too large
What is the Max number of screens that can be used in a app to be able to still publish the app
Completing the survey on another screen
Create user profile page
How to Initialize a variable as another variable from a different screen
JavaScript without Timer and WebViewStringChange
Limit exceeds in MIT app
JavaScript without Timer and WebViewStringChange
App inventor can't generate a QR code
Error: the application loops on the home screen when I open it on my phone
Problem with passing data from one screen to another
Non mi fa accedere al progetto
Need help to make button reading url from google sheet
Using Variables On Multiple Screens
Mit app inventor takes a lot of time to load a project
Cannot get different variables from different screens
Global variables initialized in Screen1 are not recognized in Screen2
I want to build a multilanguage app but i am facing issues
Problem with TinyDB and multiple screen
Limits on number of Views in App Inventor?
Server error: could not upload file. Please try again later!
How can i make my screen2 open first when i install the app not screen1. Is this possible?
Why do we need to select 2 times from spinner?
Is there something wrong with MIT App Inventor?
Dos datos entre dos screen
Dos datos entre dos screen
Uploading image with comment to cloud and showing these into seperate page
The screen is no longer displayed correctly
Se des habilita algunas opciones
I can't open a screen
How to store many tinyDB in one DB
Mp3 Sound play Problem in emulator
Low RAM and Crash issues
Whats the difference between a button with an image vs. a clickable image?
Sound fades more each time app is rerun
Bluetooth Connection lost
Invalid Screen: package null, Unknown, version 0.0
Why can't I close my app?
[PLEASE HELP] Error with screen changing
How can I select markers created on the map?
How do you change from one screen to another with a button?
Error 908: The permission Write_External_Storage has been denied while using web component to download a file
TinyDB error on second screen
App.apk show " app keep stoping"
Global variables - how copy many variables, to another screen?
Need help for a basic app
I couldn't build app
How do I upload files to the assets (Media)
Making the project has more space not only 30mb
Demora en conectar con la aplicación
Is all of this possible
A quiz app + more than 10 screens
Duda en general
Use same clock in different screens
Go from page 1 to page 2
Screen number error
My copy shortcut isn't working or I can't delete screens (don't want to delete screen 1)
Help needed with school project
The operation add items to list cannot accept the arguments: ,"[6]"
Urgent help needed :( Anybody know what is the source of this problem?
The blocks is not working
How to use Virtual Screens

see also the following statements by @ewpatton
(copied from here Are App Inventor Projects Limited to 10 Screens?)

There isn't a hard limit on the number of Screens in an app.

When used properly, multiple screens are a perfectly reasonable way to organize your app. For example, in a app for finding restaurants you may have a main screen with a map, a second screen that shows restaurant data, a third that shows menu contents, a forth that shows pictures of food, a fifth that shows reviews, etc. In this design each screen is a view over some model (cf. model-view-controller design pattern). The wrong way to use screens is to create a screen for each individual instance in your model (i.e., a screen for ABC restaurant, a screen for XYZ restaurant, etc.), which is often how screens are used because beginners haven't yet internalized the abstractions necessary to know when it makes sense to really use a new screen versus reuse an existing screen.

It's also not true that many screens necessarily implies memory issues when the app is running on the device. Android will first try to kill other applications that are not active to free up memory. With proper management, you can certainly build a multi-screen app that never runs into memory issues by closing screens to pop them off the activity stack. Conversely, you can also build an app with 2 screens that will overflow memory by constantly having one open the other and vice versa, effectively attempting to put an infinite number of screens onto the (finite) stack.

The other major consideration around number of screens is from a performance perspective in App Inventor itself, namely that it needs to load these files from the server (each screen is 2 files--designer and blocks), which takes time. There are also some not-quite-efficient design choices in App Inventor because it was originally designed to only model a single screen. These design choices cause multi-screen apps to take quite a bit of time to load and for the browser to use quite a bit of memory to support them. All screens are "open" at once in App Inventor but only one is ever shown at a time, and so this extra memory cost can slow down the website on older hardware and computers with limited memory. I have previously worked on some changes to address these performance issues but they are not yet in production.


For screens :

Don't you think these blocks would be best :

1 Like

Instead of looping over all Virtual Screens every time you need to make one visible, you could have managed a gloable currentVirtualScreen and when you are to make smother to be visible just make visibility of current to be false and make the required screen true and update the global currentVirtualScreen varialbe with the current visible screen you just made visible.


Ya but in case somehow some other virtualScreen is also open, it would close it. That's why I looped all these.

At the initial all would be visible false, so in every case one would be visible and that is refrenced by

at all time, when you need to make othere to be visible just make the current to be false and required to be true and update the global currentVirtualScreen with the new one.

wo0ow great tidy optimized way for lot of screens project [ beautiful mind ]

1 Like