App UI Freezing While Calling Web Data in Loop (Tried Clock Component Too)

Hi everyone,
I’m facing an issue in my app where I’m calling data from a Web component inside a loop, and because of that, the UI becomes unresponsive or lags while loading.
here when screen open i am calling the data:

Here’s what I’ve tried:

  1. I’m calling the data from web Once I receive the data , I’m immediately triggering another web call — basically calling the same data again and again in a chain.

  2. Then I tried to improve it by using the Clock component — so after I get the data, I enable the Clock, and then on the Clock’s Timer event, I call the data

again. But still, the UI freezes and becomes unresponsive.

Is there any efficient way to call web data in a loop without freezing the UI?

Thanks in advance.

1 Like

As the web component works asynchronously, the UI does not get blocked

As a working example see also App Inventor Tutorials and Examples: Webprefetch File by File | Pura Vida Apps

My guess is, this is because of something else
Taifun

Yes, you’re right, @Taifun — I tested it, and it’s not freezing:

However, when I attach the block shown below, the app starts lagging and even crashes in some cases.

its look like you are using infinity loop in the web response…
when you got response then again you request data? when it stops to getting data?

when the leave the chat room bcz i want to fetch the chats in realtime.

Why is there a red error on response Content? Click the red x to read the error message

What is the length of these 2 arrays/lists?

Taifun

1 Like

i clear that error this was not the cause of that issue

in first llist i am storing the chats and then after storing i am placing that data in chatview

1 Like

This does not answer the question

If these lists are very long this heavy processing then could blocb the user interface and result in runtime error

Taifun

1 Like

so whats the solution for this?

instead of the extension just use web block parse json and dict block and try again

i tried with that as well, but still App UI is Freezing.

you still did not answer the questions

for example display only the last 10 messages
Taifun