Jump to content

Mobile Webapp temporarily in offline mode


GerhardV

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...