GerhardV Posted May 9, 2017 Share Posted May 9, 2017 Hi citizens of the UniGUI republic! I have a mobile application that will be mostly accessed on tablets via 3G/2G or LTE. It may happen that these signals "disappear" from time to time for short periods which means that the app cannot communicate back to the server when this happens. Now as I understand it, the session still exists on the server as long as the the page didn't get refreshed, correct? Does anybody have any experience or ideas on how to handle this? Is it possible to save the data to "localstorage" or even persist the data via the File-API and then send it later? The data that needs to be send back is a relatively small record, maybe 8-12 fields. It maybe that this ends up being a list of records depending on how long the "offline" will be. The session timeouts will be set accordingly obviously. Any input would be appreciated. Thanks Gerhard. Quote Link to comment Share on other sites More sharing options...
GerhardV Posted May 9, 2017 Author Share Posted May 9, 2017 I have noticed that when I pull the "connection" (switch off) on the client side that it retries connecting to the server. @Farshad is that functionality of UniGUI? I assume so as it is showing a retry counter. If so, is there anyway to trap or intercept that event on the client side? Edit: OK I see on the ServerModule is a ConnectionFailureRecovery property but not sure of a way to attach some JS code when that happens. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 10, 2017 Administrators Share Posted May 10, 2017 @Farshad is that functionality of UniGUI? Yes, that's uniGUI which tries to recover from connection failure. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 10, 2017 Administrators Share Posted May 10, 2017 Hi citizens of the UniGUI republic! I have a mobile application that will be mostly accessed on tablets via 3G/2G or LTE. It may happen that these signals "disappear" from time to time for short periods which means that the app cannot communicate back to the server when this happens. Now as I understand it, the session still exists on the server as long as the the page didn't get refreshed, correct? Does anybody have any experience or ideas on how to handle this? Is it possible to save the data to "localstorage" or even persist the data via the File-API and then send it later? The data that needs to be send back is a relatively small record, maybe 8-12 fields. It maybe that this ends up being a list of records depending on how long the "offline" will be. The session timeouts will be set accordingly obviously. Any input would be appreciated. Thanks Gerhard. Unfortunately, you can not switch to an "offline mode" and return to online mode later. uniGUI needs a persistent connection to work with. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted May 11, 2017 Share Posted May 11, 2017 @Farshad Is there a possibility to know when lost connexion (client side) ? @Gerhard In this case (an idea), we can store, just after connexion lost, a text file on smartphone (see how to on Android), wich contains all SQL queries. Then, after recover connexion, execute this queries and empty the temporary txtfile. Regards Quote Link to comment Share on other sites More sharing options...
GerhardV Posted May 12, 2017 Author Share Posted May 12, 2017 Yes that is the idea I had in mind as well. Just need a hook to to execute the necessary JavaScript. But that said...I can completely understand what Farshad is saying as we cannot really continue with the app as it is not stateless and the server needs to know the state of the client to keep track of things. Probably better to write this with Delphi Mobile and then write the "dashboard" with UniGUI. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.