Welcome! Log In Create A New Profile

Advanced

[WM24] Is there a way to preload data?

Posted by RobertLeo 
[WM24] Is there a way to preload data?
March 03, 2020 11:05AM
Greetings,

I have an issue with windev mobile app in which when attempting to open a window that requires pulling a big chunk of data, it takes a very long time to load.

To make a long story short, we used a looper to call in menus and these menus are loaded with links and calls to multiple other windows and would open them when said looper is pressed, and the process to load this window with these loopers takes a long time. Is there any way to preload data?
Argus
Re: [WM24] Is there a way to preload data?
March 04, 2020 06:53PM
Of course there is... load whatever you need in queries, arrays or anything else you like, and in whatever window you have, read them from there.
Re: [WM24] Is there a way to preload data?
March 05, 2020 03:30AM
Argus Wrote:
-------------------------------------------------------
> Of course there is... load whatever you need in
> queries, arrays or anything else you like, and in
> whatever window you have, read them from there.

that's what I do at the moment, problem is whenever the screen with said queries appear, the app would pull all of the data in relation to that from the database, not only making it load for a long time depending on how many data is pulled, but also costly for data capped mobile data
Re: [WM24] Is there a way to preload data?
March 05, 2020 01:17PM
Hey Robert,

You don't tell us what your infrastructure is?

Are you loading your data from a remote DB or from within the App?
Are you using mobile data?
If so is it local wifi (during testing) or it it 3G, 4G etc...?
Just how much is a "big chunk" of data?

The more info you provide; the better chance you have of someone understanding your problem and then being able to help you...

Regards,
Darren.
Argus
Re: [WM24] Is there a way to preload data?
March 05, 2020 02:42PM
if you are already doing it, you are not doing it the right way or at the right place...

Put your code in a thread, do it in advance, do it later when the user scrolls, there are many ways of managing the problem... it all depends of all the things you are not telling us.
Re: [WM24] Is there a way to preload data?
March 06, 2020 04:12AM
DarrenF Wrote:
-------------------------------------------------------
> Hey Robert,
>
> You don't tell us what your infrastructure is?
>
> Are you loading your data from a remote DB or from
> within the App?
> Are you using mobile data?
> If so is it local wifi (during testing) or it it
> 3G, 4G etc...?
> Just how much is a "big chunk" of data?
>
> The more info you provide; the better chance you
> have of someone understanding your problem and
> then being able to help you...

Data is loaded from a remote DB
I tested using wifi, LTE, and 4G (3G and below is essentially non existent in terms of internet connection here)
in terms of amount of records, about 30 records at most, each records containing an image as well as a few text, and even then it takes about 8 seconds minimum on a stable wifi connection, 15 on 4G
Re: [WM24] Is there a way to preload data?
March 06, 2020 04:19AM
Argus Wrote:
-------------------------------------------------------
> if you are already doing it, you are not doing it
> the right way or at the right place...
>
> Put your code in a thread, do it in advance, do it
> later when the user scrolls, there are many ways
> of managing the problem... it all depends of all
> the things you are not telling us.

I have 2 applications at the moment and both has similar issues,

What I did:

Application 1:

I put multiple queries at the initialization of the window, one to call in data from a table containing about 30 records into a horizontal looper, each looper opens it's own window. the second query calls in data from a separate table to fill in a vertical looper, there is only 4 records on this one. When opening this window it takes about 8 seconds on WiFi, 15 on 4G, and every time attempting to open this window, all the data had to be loaded again.

Application 2:

I have a window where there are multiple tabs, for the most part each of them are for displaying data, but it takes a long time to load because one of the tabs contain charts, and it takes a while for the charts to initialize as it takes data from the table it is associated with, and when closing this window and reopening it again, the data is pulled from the DB again, making the overall load time pretty abysmal
Re: [WM24] Is there a way to preload data?
March 07, 2020 05:30PM
Hello Leo

There was a similar question here on the forum so I was already answering that.

I have an application that pulls large amounts of data every few seconds.

The data is in the cloud, the database is MySQL
Data is loaded from 4 tables

Here is the application link so take a look

[play.google.com]

Greeting

[infosonline.net]



Edited 1 time(s). Last edit at 03/07/2020 06:04PM by infos.
Argus
Re: [WM24] Is there a way to preload data?
March 07, 2020 11:15PM
> most, each records containing an image as well as

Do your query WITHOUT your images and load your looper that way, then in a secondary thread get one image after the next and display it.

It will not be faster overall, but your user will be able to work much faster...

Of just replicate the data locally and forget about the problem whatsover... I'mu using WXreplication to do that in all of my mobile apps.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: