Troubleshooting and Debugging Mobile Applications (Magic xpa 4.x)
The most common problem regarding a RIA client is that the client fails to connect to the Web server that is serving the RIA application.
There are several scenarios where this problem can occur:
-
The mobile device fails to communicate with the Web server.
In this case, in the Broker Monitor, you will not see any requests in the Broker Monitor or any connection indication in the Web server log.
a. If the communication is done using WiFi, verify that the device is connected to the correct WiFi router.
b. Try connecting from the device browser to the Web server.
For example: http://192.168.137.1/MagicScripts
If you do not get any response, then your Web server is not configured properly or your firewall is blocking the communication. Try to enable inbound http/https communication in the firewall rules. If the problem remains, try to disable the firewall completely. If you can connect from a browser to the web server or if your application is now working, then you can enable it again and make sure that the firewall enables inbound connections on port 80/443.
To enable port 80: In the Control Panel go to Windows Firewall > Advanced settings > Inbound Rules. Open World Wide Web Services (HTTP Traffic-In) and select Enabled.
-
The client application failed to connect to the server using the connection settings defined.
In this case, you will not see any requests in the Broker Monitor but you will see the access to the server in the Web server log.
a. Check that the execution.properties file is in ANSI format.
b. Check that all the attributes in the execution.properties file have the correct value (case sensitive).
c. If the settings.properties file contains a URL attribute with reference to an external execution file, check that:
* The external file can be accessed from the mobile device. You can check it by entering the same URL value on a browser on the device.
* The external file is in ANSI format and all the attributes in this file have the correct value (case sensitive).
d. Verify that the Magic xpa RIA server is up and is running the project defined in the settings properties.
To check your file on Windows desktop, you can rename the file to execution.properties, place it in the %EngineDir%\RIAModules\Desktop folder and run the MgxpaRIA.exe application in that folder. If everything is properly defined, the RIA application should start on the Windows client.
As in the desktop RIA, you can activate debug logs on your mobile client by defining a proper value for the InternalLogLevel property in the [MAGIC_RIA] section of the Magic.ini file.
Retrieving the logs is done differently for each platform as defined below.
Android
The application log is written in the internal device log.
You can see the log by using the Android Debug Bridge (ADB) utility.
To view the log, run the following command: adb logcat.
To view only the RIA client related entries in the device log, run the following command: adb logcat MAGIC:D *:S. Note that this filtering will not show crashes or illegal actions.
To clear the log, run the following command: adb logcat -c.
To save the log to a file, run the following command: adb logcat > file.log.
If you need to provide a log of a specific scenario or crash, you need to clear the log first, run the action that caused the crash and then save the full log to a file.
For further information regarding the ADB utility, refer to Using the Android Debug Bridge (ADB) Utility.
iOS
The application log can be retrieved to the PC using iTunes.
Simply connect your device to iTunes. In the device apps, select your application and then you can retrieve the log file.
See also: Creating and Extracting Magic Client Log Files from iOS Devices