Speed of execution problem

Hello,
I created an application that communicates with different phones via the CLOUD database.
On one of the telephones, the speed of execution is optimal (respect for the different times).
However, on another similar phone, the execution speed is very slow.
Do you have a solution?
Thank you in advance for your answers

Hello...
Please explain what you mean by 'execution speed'. What is the phone doing? Using it for chat; exchanging data; exchanging images or what? How much slower is the not so great phone.

  • one phone is great, the other not so great.
    Are both using the same Android operating system? Are they working on the identical Wifi network? Is one working on WIFI and the other using a network. Are they the same brands? Does the great phone have a better cpu? Are both receiving messages from a third phone?

All the things mentioned could affect performance.

You asked' Do you have a solution'? We, in turn ask, what does your app do and what do the Blocks look like (please post an image) ? Why? Because without more information; we can only guess. :frowning: that differences are due to different hardware and software in the phones.

Regards,
Steve

1 Like

Hello,
The application in question is an application allowing the monitoring of agricultural plots. It allows you to view and add operations carried out on the plot in the form of data saved in the CLOUD of AppInventor database. It therefore communicates with other devices that have the application.
Here is an image corresponding to a small part of the blocks (the application consists of about ten screens) :


In order to test it, I used two phones (Samsung Galaxy J5 and Samsung Galaxy A5). With the J5, it works correctly, optimal execution speed (I took a break from 20s, and it respects them) while with the other phones, this time of 20s and almost doubled.

I hope that with this additional information it will help you see more clearly.

Regards,
Adrien

You are using cloudDB ?
And the default MIT provided instance ?

I would guess that computations across 10 screens on an older/earlier android device will take longer to process, especially with a lesser processor and ram…

A list of your probable roadblocks Adrian

  • 10 screens. One reason we recommend virtual screens over ‘real’ Screens is that it takes a bout one second to render a new Screen. App Inventor graphics are notoriously slow compared to what is possible using Java based compilers means the graphics must be posted on each screen and that takes additional ms. Possible improvement might be to only use virtual screens (see Tim’s comments).
  • you use the Map component. The Map component uses OpenStreetMap tiles in the Cloud. These take a while to refresh. You do not indicate where you get your latitude/longitude information. If you get it from the Map component, the fastest you can get a new satellite fix and trigger a LocationChanged event is every 60 seconds. If you use the LocationSensor.TimeInterval, you can usually set it to attempt a satellite fix every 20 to 30 seconds at best.
  • you use a Map.PanTo Block. My experience is that technique sometimes glitches. Better to use a centerFromString Map.CenterFromString block. Use a Map.ZoomLevel block in your Screen.Initialize and set it to 17.
  • you use a lot of Notification.ShowAlert blocks. These notifications display for between several seconds (short) to twice that (long). It might be better to display this information in a Label. Do they slow down the app? Certainly.
  • note Tim’s question regarding your database. A CloudDB on MIT’s server or your own server or on a service. The MIT CloudDB is notoriously unreliable; especially on week ends or times of many users using the MIT server. With as many changes as you are making using a Timer, you should be using your own server or a service which might be faster.
  • your J6 is either an Android 5.1 or upgraded to 6.01 with a 1.2Ghz cpu; your A5 6.01 or upgraded to 8.01 with a 1.9 GHZ cpu . Guess is your J5 is the lagging phone but you say it is the faster.
  • you populate your Markers with a FeatureCollection; that may slow down rendering of the OSM image
    -you expect everything to update every 20 seconds. Updating that frequently is probably too fast for what you are trying to do. Why does everything need to update that frequently? You might get better performance by sampling less frequently, giving the map time to catch up with calls to the database etc.

Good luck Adrien.