Those two applications will then work in synchronization whenever your users perform an action requiring PHP code:
- Your mobile application will send its state to its web twin in your server. UseAjaxUri MPage property stores the URL of the web application, that is how your mobile application finds its web twin.
- Your web application will retrieve the data, perform any needed operation, and send back a new state to your mobile application.
- Your mobile application will retrieve and render that new state.
Before you choose to use UseAjax on any screen (MPage) of your application, you should take into account some facts:
- Your screen will be unusable on devices without a working Internet connection.
- Your screen will be unusable if the server hosting your web application is down.
- Your screen will be frozen, with a loading message box, while it retrieves each new status from the server. Depending on your user’s Internet connection, that can make the application feel slow or unresponsive.
Run in a Web Browser
Tip: There is a video tutorial which covers how to run UseAjax applications in a web browser.
When you are working on a mobile application with screens using UseAjax, you should probably empty UseAjaxUri property. When empty, UseAjaxUri points to your local web server, that way your mobile and web twin applications will be the same.
If UseAjaxUri is already pointing to the location where the web twin will be hosted, whenever you run your application in a web browser to test it, your mobile twin running in your web browser will try to synchronize with whatever UseAjaxUri is pointing at, probably a previous version of your web application, or maybe an empty location. Anyway, it will probably cause your screens using UseAjax to misbehave.
It is once you are about to deploy your application that you have to set the final values of those UseAjaxUri properties.