Salesforce

Execution on Android (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Execution on Android (Magic xpa 3.x)

You can run a program or project on an Android device or simulator directly from the Studio by first pressing in the Execution on Android toggle button. You can do this from the Magic xpa toolbar or the Debug menu.

Once the button appears pressed in, you can execute your program or project on an Android device directly from the Studio:

  1. Press F7 to execute a Rich Client program. This will switch the engine to Runtime mode and launch the application on the mobile device or simulator using the selected program as the start program.

  2. Press Ctrl+F7 to execute the project. This will switch the engine to Runtime mode and launch the application on the mobile device or simulator using the start program that is defined in the execution properties file.

For this to work, you should first:

  1. Install the application on the mobile device or simulator.

    You can install the generic MagicDev.apk, which is available in the RIAModules\Android folder.

    Refer to Customizing Your Application and Installing an Application on a Mobile Device or Simulator for more information on how to customize and install the application on an Android device.

Note: When the Execution on Android button is pressed in and you run a project or program, if the APK necessary to run the package is not installed on the device, the Magic xpa Studio will install it. Since version: 3.1

  1. Connect the device to your network so that the application will be able to connect to the Magic xpa server to run the project.

  1. From the Android settings menu, enable the USB Debugging option.

  2. If you are using a device, connect the device to the PC using a USB cable.

  3. In some cases, you will need to install the generic Google USB driver (from the Android SDK Manager, install the Google USB Driver package from the Extras folder) or the driver that came with the device.

  4. Define the application package name in the Run.bat file located in the RIAModules\Android folder under the installation folder.

    To do it, open the file using a text editor and change the value of the PackageName variable to your package name, as it is defined in the settings.properties file.

    For example, when using the MagicDev.apk which is available in the RIAModules\Android folder, you should set the name to com.magicsoftware.magicdev.

To check if your PC can access your device, open the command prompt, navigate to the RIAModules\Utils\ADB folder under the installation folder and execute the following command: adb devices.

You should see your device in the devices list.

The execution of the application on the Android device or simulator is done using the Android Debug Bridge (ADB) utility.

You can change the ADB commands by altering the Run.bat file located in the RIAModules\Android folder under the installation folder.

Note:

If the server on which Magic xpa is running is not defined in DNS, the Android mobile client will fail to access the Magic xpa server, since the device cannot translate the machine name to the IP address and you will get the following error: "Unable to resolve host name". If you encounter this error, you need to set the full URL with your machine's IP address in the HTTP Requester environment setting. For example: http://192.168.0.111/MagicScripts/MGrqispi.dll.

Usually, when using the Genymotion simulator, you can define the following value as the IP address: http://192.168.56.1/MagicScripts/MGrqispi.dll or http://10.0.3.2/MagicScripts/MGrqispi.dll (192.168.56.1 and 10.0.3.2 are the default host IP addresses that the Genymotion VirtualBox supplies).

Since version:

2.4

Reference
Attachment 
Attachment