Mobile Development Environment (Magic xpa 4.x)
The Android, iOS and Windows 10 Mobile platforms provide a managed, controlled process for installing native applications on the mobile devices. Each Magic application that you want to deploy on these platforms must be packaged as a separate, self-contained application with its unique name, icon and application properties. The process of building an application involves editing configuration files and running a “build” tool that creates a new, unique application that embeds the Magic RIA client engine. This application can then be deployed on the mobile devices using the supported distribution mechanisms.
Information about the minimum requirements is listed in the Compatibility Guide.
Android prerequisites
JDK
The JDK is installed automatically during the Magic xpa installation when you installed the Web Services Framework component.
If you did not install the Web Services Framework component, you can download the JDK and the Android SDK from:
Android SDK Manager
Download the Android SDK from:
During the installation of the Android SDK, the Android SDK Manager will be launched.
Select the Android versions that you want to use for compiling your application. For each version you need to select at least the SDK Platform component.
To create a custom application, you need to install the items listed below **:
o Android SDK Tools (revision 24.x)
o Android SDK Platform-tools (revision 23.x)
o Android SDK Build-tools (revision 23.0.1)
o SDK Platform
o Android Support Repository
o Google Play Services
o Google Repository
o Google USB Driver
Continue with the installation by clicking on the Install XXX Packages button.
Gradle Settings
** If you installed a later version than the ones defined above, you might need to update the version number in the gradle setting file. To do this, open the build.gradle file (located at RIAModules\Android\Source\app). In this file, change the version numbers in the compileSdkVersion and buildToolsVersion parameters to the version that you installed. For example:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
The compileSdkVersion parameter is the version number of the SDK platform and the buildToolsVersion parameter is the version number of the Android SDK Build-tools.
iOS prerequisites
A Mac with Xcode.
The Magic xpa server must run in Background deployment mode in order to handle requests from the mobile RIA client.
To run your application on a mobile device, the device must have access to your server.
You can do this in several ways:
-
Use the WiFi capabilities of the device to connect your device to the same network as your local machine.
-
If your device supports USB tethering you can connect the device to your machine, enable the USB tethering and then use the IP address that was given to your machine as the server address.
-
If you develop on a machine that has WiFi capabilities, you can use that WiFi to turn your machine into a wireless hotspot and connect your device to that hotspot.
For further information, refer to the Testing an Application on a Mobile Device Technical Note.
You can use the platforms’ device simulators to test your application. However, the simulators’ features are limited compared to real devices and the simulators might behave differently. Therefore, it is recommended to develop and, especially, test your application using a real device.
Android
The Android emulator can run on any Windows desktop.
To run the Android emulator, you need to download and install the Java SE Development Kit (JDK) 6 and the Android SDK.
|
To see a video demonstration about installing the Android emulator, click here.
|
After installing the SDK platforms, configure the Android emulator and virtual environment by following the given steps:
-
Click on Windows Start menu.
-
Start the SDK Manager.
-
Click on Tools menu.
-
Start the Manage AVDs entry.
Android Virtual Device Manager
In the Android Virtual Device Manager screen’s Android Virtual Devices tab, add a new device and specify:
-
Name – The name for the virtual device.
-
Device – The device itself.
-
Target – Choose the Android version, for example: Android 4.0. You will see different Android versions depending on the SDK versions installed in the SDK Manager.
-
SD Card Size – Define a size for the SD card, for example: 20.
You can also define these settings in the Device Definitions tab and then click the Create AVD button.
After the device creation is complete, the device will be added to the list. Select the device and click Start to run the emulator.
iOS
The iOS simulator runs only on Mac OS computers and requires the latest version of the iOS development environment (Xcode).
To run the simulator, open the project in Xcode, set the Scheme combo box (on the top left side) to the required device (for example: iPad 5.0 Simulator) and click the Run button.
Windows 10 Mobile
To run the simulator, open the project in Visual Studio, set the Platform combo box (on the top menu bar) to the required device and click the Run button.