Ria for mobile devices

67 %
33 %
Information about Ria for mobile devices
Technology

Published on December 24, 2012

Author: kaissfrikha

Source: slideshare.net

RIA for Mobile DevicesDeveloper Guide

ContentsPreface............................................................................................................................................................................................. 4Developer Guidelines........................................................................................................................................................................ 4 Device characteristics................................................................................................................................................................... 4 User interaction ........................................................................................................................................................................... 4The Magic RIA Client......................................................................................................................................................................... 5 Form types................................................................................................................................................................................... 5 Coordinate system ....................................................................................................................................................................... 5 Form scrolling .............................................................................................................................................................................. 6 Placement ................................................................................................................................................................................... 6 Form orientation.......................................................................................................................................................................... 6 Form sizes.................................................................................................................................................................................... 7 Supported controls and properties ............................................................................................................................................... 7 Appearance of controls ................................................................................................................................................................ 7 Image control .............................................................................................................................................................................. 7 Parking on controls ...................................................................................................................................................................... 7 Menus ......................................................................................................................................................................................... 7 Spinner images ............................................................................................................................................................................ 8 Virtual keyboard support.............................................................................................................................................................. 8 Special BlackBerry keyboard events.............................................................................................................................................. 8 Touch events ............................................................................................................................................................................... 8 Incremental Locate ...................................................................................................................................................................... 8 Task types.................................................................................................................................................................................... 8 Dates ........................................................................................................................................................................................... 8 Window navigation ...................................................................................................................................................................... 9 Application termination ............................................................................................................................................................... 9 Fonts ........................................................................................................................................................................................... 9 Font size conversion................................................................................................................................................................... 10 Colors ........................................................................................................................................................................................ 10Interaction with the Mobile Device ................................................................................................................................................. 10 File system and file operations ................................................................................................................................................... 10 Querying device characteristics .................................................................................................................................................. 11 Finding the device location (GPS)................................................................................................................................................ 11 Camera support ......................................................................................................................................................................... 11 2

Accessing the mobile devices’ capabilities – Android and iOS ...................................................................................................... 12 Using native OS code – Android and iOS ..................................................................................................................................... 12 Integrating 3rd party libraries – Android and iOS......................................................................................................................... 13 Android................................................................................................................................................................................. 13 iOS........................................................................................................................................................................................ 13Development Environment............................................................................................................................................................. 13 Minimum requirements for mobile devices ................................................................................................................................ 14 BlackBerry............................................................................................................................................................................. 14 Android................................................................................................................................................................................. 14 iOS........................................................................................................................................................................................ 14 Magic xpa server configuration................................................................................................................................................... 14 Mobile device simulators ........................................................................................................................................................... 14 BlackBerry............................................................................................................................................................................. 14 iOS........................................................................................................................................................................................ 15 Android................................................................................................................................................................................. 15Running Your Application on a Mobile Device or Simulator.............................................................................................................. 16 Customizing your application ..................................................................................................................................................... 17 Creating a custom application requires code compilation....................................................................................................... 17 BlackBerry Smartphones........................................................................................................................................................ 17 BlackBerry PlayBook.............................................................................................................................................................. 19 Android................................................................................................................................................................................. 20 iOS........................................................................................................................................................................................ 21Installing an Application on a Mobile Device or Simulator................................................................................................................ 23 BlackBerry Smartphones........................................................................................................................................................ 23 BlackBerry PlayBook.............................................................................................................................................................. 24 Android................................................................................................................................................................................. 24 iOS........................................................................................................................................................................................ 24Troubleshooting & Debugging......................................................................................................................................................... 25 Troubleshooting......................................................................................................................................................................... 25 Debugging ................................................................................................................................................................................. 26 Android................................................................................................................................................................................. 26 iOS........................................................................................................................................................................................ 27 BlackBerry............................................................................................................................................................................. 27 3

PrefaceThe Magic RIA client for iOS™, Android™, BlackBerry® and Windows Mobile® is a native operating system(OS) application for any of these devices, implementing the Magic RIA client protocol. Using the Magic RIAclient for the different mobile devices, developers can deploy highly interactive enterprise RIA applicationson the various mobile devices.Developer GuidelinesDeveloping mobile RIA applications using Magic xpa requires the same skill set as developing desktop RIAapplications. However, since the devices’ capabilities, user interface and expected user experience aresignificantly different from a desktop computer, there are important differences that need to be taken intoaccount when designing the application screens and planning the user interaction.Devices differ in screen size, fonts, expected interaction device features (such as a camera and GPS), securityrelated features and more. This document is designed to assist developers to take full advantage of eachdevice.Device characteristics • Screen size and orientation – Mobile devices have various resolutions and screen sizes in both landscape and portrait orientations. • Keyboard devices – Some mobile devices have a full QWERTY keyboard. In addition to a keyboard, some devices have a dedicated Menu key, an Esc key and a trackpad or trackball that are equivalent to the desktop keyboard arrow keys. The trackpad also provides a dedicated Fire action when pressed. Keyboard-only devices have a fixed screen orientation and cannot be rotated. • Touch devices – Some mobile devices have a touch screen, some in addition to a full keyboard, and some without a keyboard. Touch devices support screen rotation and provide an on-screen virtual keyboard when a full keyboard is not available.User interaction • Windowing model – Mobile devices support a simple stacked window model. Each application can open multiple windows, but each new window is stacked on top of the previous windows and is inherently modal. As there is no mouse pointer, windows cannot be manipulated (moved or resized) by the end user. When an application is run, its main window (and subsequent stacked windows) occupies the entire device screen. • Form navigation using trackpad – Some mobile devices (such as BlackBerry) are optimized for keyboard navigation and input. Typically, the trackpad is used to navigate between fields on the form, while the Fire action is used to select values and perform actions. Unlike a desktop keyboard, there is no TAB key so there is no standard key to move to the Next Field or the Previous Field. All navigation between fields and inside a field (an Edit control), is done using the trackpad directional actions. • Form navigation using touch keyboard – Touch devices use an on-screen virtual keyboard. Some devices rely on tapping on form controls (fields) to navigate between the fields while others have 4

Tab functionality in the virtual keyboard. The navigation inside a field (an Edit control), is done using a long press on the field content. • Context menu – The context menu is an important and central user interaction tool. Since the screen size is relatively small, it is common to perform most tasks using the context menu, instead of “wasting” screen space on buttons and on-screen menus. • Input modes – The Edit control is always in Insert mode. There is no equivalent Overwrite mode on the mobile devices. • Running in the background – The mobile devices’ OS is a multi-tasking OS, meaning that each application can run either in the foreground or in the background. The end user can see the running applications and switch between them. An application running in the background is not suspended and continues to run, but does not have access to the screen.The Magic RIA ClientThe Magic RIA client running on the mobile devices is a native device OS application designed to takeadvantage of the mobile device capabilities, while being connected to a scalable, robust enterprise server.The Magic RIA client for the mobile devices implements a subset of the capabilities of the Magic RIA clientfor .NET Desktop, as they are applicable on the various mobile devices.Form typesAs described above, all forms are modal by definition. There are no modeless windows and focus cannotmove between open windows. When defining form types in the Form Editor, all form types are ignored andthe Modal form type is used. • Full-screen forms – When setting the Window Type property to a value other than Floating, the form will automatically expand to the entire screen area of the device. All position and size properties of the form will be ignored. • Pop-up forms – When setting the Window Type property to Floating, the form will appear as a pop- up window. Note: Pop-up forms are available for Android and BlackBerry devices. In Android, you do not have control over the location and size of the pop-up form.Note: It is required that each application start with at least one full-screen form that will remain open for theduration of the session. It is, of course, possible to open additional forms; however, when this initial full-screen is closed, the application will terminate.Coordinate systemWhen using dialog units as the form units of measurements, the dialog units are converted to pixels usingthe metrics of the form’s font. Since mobile devices do not support Windows fonts, the metrics of thedefault font (which is 5x13) is used.In addition, mobile devices are available in various resolutions and sizes. To have the same appearance on allof the devices, the dimensions of the form and controls are multiplied by a factor, which is the device DotPer Inch (DPI) divided by Windows DPI (96). 5

So, when converting between dialog units and pixels, the mobile client uses the following formula: X in pixels = X in dialog units * 5 * (mobile device dpi / 96) Y in pixels = Y in dialog units * 13 * (mobile device dpi / 96)Note: Although Windows calculations are based on 96 DPI, the actual screens’ DPI is a bit different, so thesizes seen in Windows will not be exactly the same as seen on the mobile devices.Other form units of measurements, such as centimeters and inches are not supported on BlackBerry devices.Form scrollingFor large forms, a scroll bar will appear on the screen, and moving up and down between fields will scroll theform.Notes: • For BlackBerry devices, the BlackBerry user interface (UI) does not natively support horizontal scrolling of forms. If you place controls outside the visible area of the form to the right or to the left, no scrollbar will appear, and those controls will be inaccessible. • For Android devices, the Android interface allows only one scroll object inside a hierarchy. This means that for example, if the form has a scrollable object, such as a Table, Browser or Subform control, then the scroll can be done in either the form or the sub object, but not on both. For additional information, refer to the “Form Scrolling – Android” topic in the Magic xpa Help.It is recommended to use placement so that the controls will fit into the form and scrolling will be avoided.PlacementThe placement mechanism is implemented in a specific way on the RIA client, to accommodate differentdevice resolutions, and to handle device rotation.The placement mechanism is relevant for “full-screen” forms only, and works as follows: • Resize on open – Before opening the form, the original form size (as defined by the developer) is compared with the current screen size. The difference between the sizes on each axis is considered a window resize, and will activate the placement mechanism on all controls. This enables forms designed for smaller screen resolutions to “expand” in higher resolutions. • Resize on rotate – On touch devices, it is possible to rotate the device, effectively changing the resolution on the fly, such as from 480x360 to 360x480. In such a case, the currently displayed form will consider the new resolution as a window resize event, and will activate the placement mechanism on all controls.Form orientationIn Android devices, you can lock the orientation by entering either orientation=portrait ororientation=landscape in the display form’s Additional Information property. 6

Form sizesThe RIA client supports both form scrolling and placement. However, when developing an application thatneeds to run on devices with significantly different screen sizes, such as iPhone and iPad, it is best practice todevelop two separate forms, since the number of controls will be different on each device.Placement should be used for each of the form types, so for each type, different devices can be used.When using dialog units as the form units, the Width and Height values of a full screen form with a title barare: • For iPhone: 18.75 x 37.5 • For iPad: 53.5 x 111.5 • For Android and BlackBerry: different according to the device sizes.Supported controls and propertiesThe following controls are supported on the mobile devices’ RIA client: Subform, Label, Edit, Button, Group,Line, Image, Browser, Check Box, Combo Box, Table and Column.BlackBerry also supports the List Box and Radio controls.The Rich Text, Rich Edit, Tab, Tree and .NET controls are not supported on mobile devices.Most of the form and control properties are supported on the mobile devices’ RIA client. For a full list ofsupported properties, refer to the Magic xpa Reference Guide.Appearance of controlsControls for mobile devices are different than the Windows controls in their appearance, minimum size andspace padding. This means that the size of the controls defined using the Magic xpa Fit to Size option maynot be large enough to display the entire control text (due to the larger padding on the mobile devicecontrols).Image controlAs mentioned above, the control sizes change according to the device DPI.Images with the Copied style do not change and use the same amount of pixels as in the image, so theimages will appear in different sizes when used on devices with different DPIs.It is best practice to use Distorted Scaling or Scaled to Fit styles to attain the desired appearance.Parking on controlsSome controls, such as the Push Button, are not parkable due to the device’s behavior. In such cases, thecurrent control will remain the parked control.MenusOn Android and BlackBerry devices, context menus are available at both the form and the control level. OniOS devices, context menus are only available at the form level.Note that only first level menus are supported.On BlackBerry devices, a large amount of menu entries may cause an out of data error. 7

Spinner imagesOn Android and iOS devices, the SetCrsr function is used to show a spinner image (for example, beforecalling a Batch or non-interactive task that takes a long time to execute).Virtual keyboard supportOn touch devices with a virtual keyboard, the virtual keyboard is automatically displayed when parking oncontrols that require keyboard input, namely modifiable Edit controls. On other controls, the virtualkeyboard is automatically hidden.Note that when the virtual keyboard is displayed, the visible part of the form becomes much smaller. TheRIA client automatically scrolls the form so that the parked control is shown in the visible area, as the usernavigates between the fields.Special BlackBerry keyboard eventsThe BlackBerry client implements a special behavior, to enable better keyboard and navigation handling onthe BlackBerry device. The following special behaviors are defined: • When parking on controls that do not expect keyboard input (such as Radio Button controls, or Edit controls that are not modifiable), pressing the Enter (sometimes referred to as the “return”) key, will trigger the OK Magic xpa internal event. This event can be handled by the application developer. • When parking on controls that do not have a selection default behavior, pressing the trackpad/trackball will trigger the OK Magic xpa internal event. This event can be handled by the application developer.Touch eventsFor touch devices, the touch events are maps to the appropriate Magic xpa actions, as follows: • “Touch”, “click” or “tap” events – Equivalent to the desktop mouse-click behavior. These events move the focus between fields on a form. Touching on selection controls changes the controls’ selection. Touching on buttons triggers the buttons’ event. • “Press” or “hover” – Triggers an OK Magic xpa internal event. This event can be handled by the application developer. • “Swipe” events are used to scroll in the form or control. Note: BlackBerry supports vertical swipes only.Incremental LocateIncremental Locate is not supported on mobile devices.Task typesDue to device limitations, the client does not support parallel programs.DatesThe Date Mode environment setting is not supported for mobile devices. The mobile devices date formatwill be used. 8

Window navigationAs described above, mobile devices support a simple stacked window model. Each application can openmultiple windows, but each new window is stacked on top of previous windows and is inherently modal.Closing the current window and returning to the previous window can be done either by raising the internalExit event or using the built-in capabilities of the mobile devices: • BlackBerry – using the ‘Escape’ button • Android – using the ‘Back’ button • iOS – using the ‘Back’ button on the window title bar (if the window was defined to open a System menu)Application terminationThe application can be closed either by raising the internal Exit System event or using the built-in capabilitiesof the mobile devices: • BlackBerry – using the ‘Escape’ button from the first screen of the application • Android – using the ‘Back’ button from the first screen of the application • iOS – using the close button (‘X’) on the window title bar from the first screen of the application (if the window was defined to open a System menu)When pressing the mobile device’s ‘Home’ button, the application will remain running in the background.Note: When terminating the application in other ways (such as from the Task Manager), the context on theserver will not be released automatically. It will be released after the context timeout period.FontsEach device has a set of available fonts that are usually different from the fonts found on a Windowsdesktop. As the mobile RIA client uses the same font table as other interfaces, it is recommended to defineseparate font entries for use on each device. Since it is not possible to select mobile fonts using the Windowsfonts dialog box, in order to enter these fonts, you need to edit the fonts table directly using a text editor.Example font table entries: • iOS Helvetica font: iOS font,Helvetica,14,0,0 • iOS Helvetica font: iOS bold font,Helvetica-Bold,14,0,0 • Android Droid Serif font: Android font,Serif,14,0,0 • Android Bold Droid Serif font: Android bold font,Serif,14,0,0,Bold • BlackBerry BBAlpha Sans font: BB font,BBAlpha Sans,14,0,0 • BlackBerry Bold BBAlpha Sans font: BB bold font,BBAlpha Sans,14,0,0,BoldNotes: • On Android you need to send the font family name and the style of the font you want. The system will find a matching font for you. For example, to use a Droid Serif font use: "Android Serif bold,Serif,12,0,0". • If the font defined in the font table is not found on the mobile device, the default font will be used with the size defined in the font table. 9

• You can use an expression to change the font, so you can use different fonts for the different devices. • On Android, you can see the font list in the System/Fonts folder.Font size conversionTo display fonts properly on the mobile devices and maintain a similar experience in the Magic Form Editor,the Magic RIA client automatically calculates the displayed font size according to the following formula:(font size on mobile device in pixels) = (font size on Windows in points) *(mobile device dpi) / 72This calculation ensures that the font will appear the same size, relative to the other controls both onWindows and on the mobile devices.ColorsThe mobile device RIA client uses the same color table as other interfaces, but it does not support the“System” colors available on Windows.Note: On Android and iOS, if a system color is used for the form or control, then the device default color forthe form or control will be shown. If you want to use a specific color, you need to implicitly define theforeground and background colors.Note: On Android: • On some controls – To see the border you must use a color with a system color (to get the device default). • On Combo Box controls – To see the arrow you must use a color with a system color (to get the device default).Interaction with the Mobile DeviceFile system and file operationsMobile devices support local file operations using the appropriate functions. The naming conventions forlocal folders and file names are according to the device’s OS. • Names are not case-sensitive. • Folder separators are defined using a slash mark (/).Access to the different device folders depends on the device. For example: • On Blackberry, there are typically two root file systems available: o /store – Always available o /SDCard – If there is an SD card • On iOS, the access is allowed only to a temp folder provided by the OS. When using the ClientFileXXX functions with a relative client filename, the file folder will be the temp folder. When using these functions with a full path, it is recommended to use ClientOSEnvGet(temp) to retrieve the temp folder. • On Android, you can access different folders. 10

Querying device characteristicsThe ClientOSEnvGet function enables a developer to query for specific device capabilities or features and useit for conditional execution of logic.On the mobile devices, the following predefined keys can be used to return device information: • ClientOSEnvGet (device_os) – returns the device operating system • ClientOSEnvGet (device_screen-width) – returns the device screen width in portrait mode in pixels • ClientOSEnvGet (device_screen-height) – returns the device screen height in portrait mode in pixels • ClientOSEnvGet (device_orientation) – returns the device screen orientation • ClientOSEnvGet (device_os-version) – returns the device OS version number • ClientOSEnvGet (device_model) – returns the device model number or name • ClientOSEnvGet (device_touch) – returns “1” if the device has a touch screen • ClientOSEnvGet (device_imei) – returns the device unique IMEI number (BlackBerry only) • ClientOSEnvGet (temp) – returns the temp folder on the device (iOS only) • ClientOSEnvGet (device_location) – returns the current device location as detailed below • ClientOSEnvGet (device_magic-version) – returns the RIA client version number • ClientOSEnvGet (‘device_udf|my_string’) – calls a user defined function as detailed below (Android and iOS only)On Android and BlackBerry, you can also use Java predefined keys (for example: ClientOSEnvGet(java.io.tmpdir)) to get additional information. For more information, refer to:http://developer.android.com/reference/java/lang/System.html#getProperty(java.lang.String)http://supportforums.blackberry.com/t5/Java-Development/Supported-System-getProperty-keys/ta-p/445219Finding the device location (GPS)The ClientOSEnvGet function can also be used to query the current device location using the internal orconnected GPS device. The function syntax is as follows:ClientOSEnvGet (device_location) – returns the current device location, using any of the available locationoptions (GPS, Network, etc.). The result is a string in the following format: “OK|Latitude|Longitude”, whereOK is a fixed part for testing if a result was returned, and Latitude and Longitude are the coordinates of thecurrent location. If a location could not be obtained, for any reason, an error message will be returned.Note: Location queries can sometimes take time to respond, because the GPS device is searching forsatellites. During this time, the client is blocked, waiting for a response. Developers should make properindications for the user that this is the situation. Location queries have a built-in timeout of 20 seconds.Camera supportIt is possible to initiate a camera from the BlackBerry, Android and iOS client using the ClientFileOpenDlgfunction by specifying the following value in the initial path value (second parameter): • On BlackBerry: /store/home/user/camera/ or /store/home/user/pictures/, a select file dialog box will open, with a “camera” option. • On Android and iOS: camera – the camera will be opened; images – the images (gallery) will be opened. 11

The full path name of the picture will be returned from the function. It is then possible to upload this pictureto the server using the ClientFileToServer function, or by loading it into a BLOB variable.Accessing the mobile devices’ capabilities – Android and iOSIt is possible to use the device capabilities such as calling a phone number, sending an SMS, and opening abrowser, by using the Invoke OS command with the URL of the required command. For example: • tel:1-408-555-5555 • sms:1-408-555-1212 • mailto:support@ magicsoftware.com • mailto:?to=support@ magicsoftware.com&subject=this is a test&body= test mail • http:/  /magicsoftware.comRefer also to: • http://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Introduc tion/Introduction.html#//apple_ref/doc/uid/TP40007891-SW1In addition, you can use this convention to call 3rd party applications, which can be accessed via the URLformat.For example, you can use waze://?q=New York to open the Waze GPS application and navigate to NewYork.Using native OS code – Android and iOSSometimes you need to use native OS code in your application; for example, when using custom hardware.You can do this in your application in two ways: 1. Call from your Magic application to native OS code. This can be done by evaluating the ClientOSEnvGet() function with the value of device_udf|my_string. Performing this action will send the value my_string to the function named userDefinedFunction in the mobile application code. This function exists at: o Android – The TestApplication.java file located in the RIAModulesAndroidSourcesrc folder o iOS – The AppDelegate.mm file located in the RIAModulesiOSSourceMagicApp folder 2. Raise an event from the native OS code that will be handled in your Magic application. You can then raise this event from your code by writing: invokeExternalEvent(“my_string”); where my_string is a string value that will be passed to the external event handler. 12

Integrating 3rd party libraries – Android and iOSYou can integrate 3rd party libraries in your mobile device application.The integration of the libraries should be done when you compile your application.Refer to the Using native OS code section above for further information on how to write native code in yourapplication in order to call the libraries.AndroidThere are two types of libraries that can be added to your application: 1. Generic Java libraries Simply put the library in your application’s libs folder (for example, under RIAModulesAndroidSourcelibs) 2. Android Java libraries Android libraries must be re-built as part of your application. The MgxpaRC library is an example of an Android library that exists in your Android application. If you need to add your 3rd party Android library to the application, you can place it in your application and add a reference to it in the build.xml file. For example: <property name="android.library.reference.2" value="mylibraryapp" /> If your library requires additional permissions, you will need to define them in the AndroidManifest.xml file.iOSYou should add the library to your project using Xcode.Development EnvironmentThe BlackBerry, Android and iOS platforms provide a managed, controlled process for installing nativeapplications on the mobile devices. Each Magic application that you want to deploy on these platforms mustbe 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 thatcreates a new, unique application that embeds the Magic RIA client engine. This application can then bedeployed on the mobile devices using the supported distribution mechanisms. 13

Minimum requirements for mobile devicesIt is recommended to use the following devices for demo and testing purposes:BlackBerry • Smartphone: BlackBerry OS 7 touch devices, such as 9900 (touch keyboard) 9810 (touch slider) or 9860 (touch only) • Tablet: BlackBerry Playbook 2.0 and above The BlackBerry Playbook can run the Magic xpa RIA client for Android. Refer to https://bdsc.webapps.blackberry.com/android/ for further information.Android • Smartphone: Android 2.3 and above smartphones, preferably with dual core processor (Galaxy S2, Motorola Droid, LG Optimus, HTC, etc.) • Tablet: Android 3.2 and above tablet, preferably with a dual core processor (Samsung Galaxy Tab 10.1, Motorola XOOM, Archos G9, etc.).iOS • Smartphone: iPhone 3GS and above running iOS 5.0 and above. Preferably iPhone 4S • Tablet: iPad 2 or iPad 3 running iOS 5.0 and aboveMagic xpa server configurationThe Magic xpa server must run in Background deployment mode in order to handle requests from themobile RIA client.Mobile device simulatorsYou can use the platforms’ device simulators to test your application. However, the simulators’ features arelimited compared to real devices and the simulators might behave differently. Therefore, it is recommendedto develop and, especially, test your application using a real device.BlackBerryThe BlackBerry simulator can run on any Windows desktop.You can download and install a BlackBerry device simulator from:http://us.blackberry.com/developers/resources/simulators.jspYou need to choose a device with a minimum OS version of 5.0.0.After the installation, you can run the simulator from the start menu. For example: Start Research InMotion BlackBerry Smartphone Simulators 6 6.0.0.294 9780Simulator troubleshooting: Sometimes it helps to set the ViewGraphics acceleration to Off. 14

iOSThe iOS simulator runs only on Mac OS computers and requires the iOS development environment (Xcode)of version 4.2.To run the simulator, open the project in Xcode, set the Scheme combo box (on the top left side) to therequired device (for example: iPad 5.0 Simulator) and click the Run button.AndroidThe 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) 5 or 6 andthe Android SDK.Note that the JDK is installed automatically during Magic xpa installation if you installed the Web Servicescomponent during the Magic xpa installation. You can download them from: http://www.oracle.com/technetwork/java/javase/downloads/index.html http://developer.android.com/sdk/index.html Android SDK Manager During the installation of the Android SDK, the Android SDK manager will be launched. Select the Android versions that you want to test your application on. For each version you need to select at least the SDK Platform component. To create a custom application, you need to install the Android 3.0 (API 11) SDK and have Android SDK Tools revision 19 or above. Note: Additional information on the components can be found at: http://developer.android.com/sdk/installing.html If a proxy needs to be used, define it in the Tools>Options menu. Continue with the installation by clicking on the Install XXX Packages button. After installing the SDK platforms, click the Tools menu and start the Manage AVDs entry in order to configure the Android emulator and virtual environment. Android Virtual Device Manager In the Android Virtual Device Manager screen, add a new device and specify: • Name – The name for the virtual device. • Target – Choose the Android version, for example: Android 2.2. • SD Card Size – Define a size for the SD card, for example: 20. 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. Note: Additional information on the emulator can be found at: http://developer.android.com/guide/developing/devices/emulator.html. 15

Running Your Application on a Mobile Device or SimulatorThe mobile RIA client provides a simple interface to run your application on a mobile device without theneed to compile and sign the code after each change in the application’s execution properties. This methodis for use during the development phase for testing purposes only. For deployment, you must create yourown custom application as specified later on.To test your Magic xpa application, follow these steps: 1. Prepare your Magic xpa server. Run your application on a Magic xpa server. Note that the Magic xpa server must run in Background deployment mode in order to handle requests from the mobile RIA client 2. Create a text file containing the execution settings for your application. • The file needs to contain the following lines: <properties> <property key="protocol" val="http"/> <property key="server" val="192.168.137.1"/> <property key="requester" val="MagicScripts/MGrqispi.dll"/> <property key="appname" val="XXX"/> <property key="prgname" val="XXX"/> </properties> Make sure to change the content of the lines, such as the Web server and requester alias, as per your settings. Note: A sample file, DevProps.txt, contains these lines and is located in the %EngineDir%RIAModulesAndroid and %EngineDir%RIAModulesiOS folders, so you can simply edit this file. • The file should have a txt extension, for example: DevProps.txt. Note: Using a different extension is possible, but you will need to define the MIME type on the server so that the mobile devices will be able to open the file. • Place the file on an exposed Web server alias, such as MagicScripts or MagicRIAApplications. 3. Compile the application using your signing certificate or provisioning file as described later on. A compiled application for Android is located at: %EngineDir%RIAModulesAndroidDev.APK 4. Install the application on your mobile device or simulator as defined later on. 5. After installing and running the application, a pop-up dialog box will open. In this dialog box, you need to enter a URL referring to the execution properties file on your Web server as defined above, for example: http:/  /192.168.137.1/MagicRIAApplications/DevProps.txt. 6. Click OK to run your application. Notes: • Once you complete the steps above, running the application on your mobile device will load the connection settings defined in the URL you entered. 16

• Any change you make in these settings will apply automatically when you run the application on your mobile device. This is so you can easily change the execution settings, such as the public name of the program, without having to reinstall the application on the mobile device. • To change the URL, simply rename the file on the server so the mobile device will not find it and run the application on the mobile device. You will see that the URL dialog box is shown again. • If you need to install more than one instance of the application on the mobile device, you should customize your application and change its unique identifier as defined below.Customizing your applicationYou can customize your application to show your name, icon and logo and to be signed using your owncertificate.Creating a custom application requires code compilation.BlackBerry SmartphonesTo compile the code you need to install the BlackBerry JDE (Java Development Environment) version 5.0.0and have code-signing keys from RIM.You can download the BlackBerry JDE from:http://us.blackberry.com/developers/javaappdev/javadevenv.jsp.The source code for the BlackBerry application is located at: %EngineDir%RIAModulesBlackBerrySource.You can change the characteristics of the application in the settings.properties file as follows: • jde.version – The JDE version used during the build. • jde.home – The home directory of the JDE installation. • client.title – The application title as visible to the user. • client.version – The application version. • client.description – A longer application description. • client.vendor – The vendor details. • client.copyright – The copyright message. • cod.name – The target module name that will be created during the build. Module names must not contain spaces. • build.password – This password is required by the BlackBerry application signing utility. • output.dir – The folder that will contain the built installers. It can be an absolute or relative path. • build.dir – A temporary folder location used during the build process. This folder is removed after a successful build. It can be an absolute or relative path. • OTA.dir – The target folder for the web installer files (Over-the-Air). A relative path is created in the output folder. • Desktop.dir – The target folder for the BES or BlackBerry Desktop installer files. A relative path is created in the output folder. 17

You can change the following files as well: • Icon – Replace the icon.png file in the source folder. It is recommended to use a 48x48 pixels PNG file. Other file sizes are also acceptable, but will be resized to fit the device’s icon size. • Startup screen logo – The splash subfolder contains a splash.html file, which refers to the wallpaper images. The splash.html is shown on the startup screen, so you can change the splash.html file or the images it refers to. • Execution properties – Open the execution.properties file and change the execution values. o You need to define either the execution properties’ values or a URL referring to a file containing them as defined above. o Leaving the URL property empty means that a dialog box will be opened and the end user will need to write the URL.After making your changes, you need to compile the application and sign it.Follow these steps to compile and sign your custom application: 1. Get code-signing keys from RIM. The code-signing keys are used for creating a signed application that can run on BlackBerry devices o Register as a developer on the BlackBerry developer site. This will enable you to download the necessary tools. Registration can be done at: https://origin-bdsc.webapps.blackberry.com/bdsc/?lang=na#register • Apply to receive code-signing keys from RIM. o You can do that at: https://www.blackberry.com/SignedKeys/ o Once approved, you will receive an email with the code-signing keys. Follow the installation instructions in the email.Additional details can be found at: http://us.blackberry.com/developers/javaappdev/codekeys.jsp 2. Create a signed BlackBerry file. The compilation of the BlackBerry project is done using the Ant tool. The Ant tool is located in the %EngineDir%RIAModulesUtilsapache-ant-1.8.3 folder. • Navigate to the application source folder: %EngineDir%RIAModulesBlackBerrySource. • Run the build.cmd file.The build process creates two outputs that can be used for all supported distribution methods, in thelocations configured in the build_client.xml configuration files: OverTheAir and Desktop.Note: you can edit the build.cmd file in order to troubleshoot the build process. For example: to see the fullactions, remove the -q from the command in the build.cmd file and to save the log to a file, add -l build.logto the command in the build.cmd file. 18

BlackBerry PlayBookThe BlackBerry PlayBook tablet can run Android 2.3.3 platform applications, so first you need to create anAndroid APK file and then repackage the Android applications to BAR file format. This is the compatible fileformat required for an application to run on the BlackBerry Tablet OS.Follow these steps to compile and sign your custom application: 1. Create an Android APK file. Follow the steps in the Android section above to customize the Android application and to create an APK file. Note that the BlackBerry Playbook does not allow repackaging an Android application with the three permissions shown below. Before building the Android application, you need to remove the following lines from the AndroidManifest.xml file: <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> <uses-permission android:name="android.permission.SEND_SMS"/> <uses-permission android:name="android.permission.CALL_PHONE"/> 2. Get code-signing keys from RIM. The code-signing keys are used for creating a signed application that can run on BlackBerry PlayBook devices. • Register as a developer on the BlackBerry developer site. This will enable you to download the necessary tools. Registration can be done at: https://origin-bdsc.webapps.blackberry.com/bdsc/?lang=na#register. • Apply to receive code-signing keys from RIM. You can do that at: https://www.blackberry.com/SignedKeys/. Once approved, you will receive an email with the code-signing keys. Follow the installation instructions in the email.Additional details can be found at:https://bdsc.webapps.blackberry.com/android/documentation/Configure_app_signing_2007101_11.html. 3. Create a signed PlayBook file. The repackaging is done using the BlackBerry SDK tools located in the %EngineDir%RIAModulesUtilsblackberry.tools.SDK folder. • Navigate to the PlayBook build scripts folder: %EngineDir%RIAModulesPlayBook. • Copy your Android APK file to this folder. • Open the build.cmd file using a text editor and change the following settings in it: o sdk.dir – The directory in which the Android SDK is installed. o SourceAPK – The Android APK file name. o developer_certificate – The location and file name of the developer certificate. 19

o keystore_password – The keystore password. • Run the build.cmd file. • The build process creates a BAR file and signs it.That’s it; you can now take the signed BAR file and install your application on your mobile device as detailedabove.Notes: 1. A specific version of a BlackBerry Tablet OS application can only be signed once. If you modify the application without incrementing its version and try to sign the application a second time you will receive an error. To re-sign the application you need to Increment the versionCode value in the AndroidManifest.xml file and rebuild your Android APK file. 2. If your network is behind a proxy you may need to specify the proxy host and proxy port while signing. In that case, you can perform the signing manually (instead of the batchbar-signer command used in the build.cmd file) using the blackberry-signer utility. For example: • blackberry-signer -proxyhost 10.9.3.16 -proxyport 8080 -verbose -cskpass cskpassmk -keystore DevCert.p12 -storepass cskpassmk my.bar RDK • blackberry-signer -keystore DevCert.p12 -storepass cskpassmk my.bar authorFor more information, you can refer to: https://bdsc.webapps.blackberry.com/android/documentation.AndroidTo compile the code, you need to install the JDK and SDK as defined in the Android emulator section above.The source code for the Android application is located at: %EngineDir%RIAModulesAndroidSource.You can change the characteristics of the application in the settings.properties file as follows: • sdk.dir – The directory in which the Android SDK is installed. • target – The Android version that the compilation is done for. Note that the version should be installed on your PC. You can see the installed versions using the Android SDK manager or by browsing to the android-sdkplatforms folder. The minimum value you can use is android-11. Note that although the minimum version is android-11 (meaning Android 3.0), the application will also run on Android 2.3 since the minimum SDK version is defined as android-10. • client.title – The application title as visible to the user. • client.version.code – An integer value that represents the version of the application code, relative to other versions. • client.version.name – A string value that represents the release version of the application code, as it should be shown to users. • package.name – The identifier of the project. The package name must be unique across all packages installed on the Android system. • key.store, key.alias, key.store.password, key.alias.password – The properties of the keystore. • output.dir – The folder that will contain the built installers. 20

• build.dir – A temporary folder location used during the build process. This folder is removed after a successful build. It can be an absolute or relative path.You can change the following files as well: • Icon – Replace the icons’ files in the resdrawable-XXX subfolders. o You need to provide icon files in all of the following sizes: 36x36, 48x48 and 72x72 pixels. • Startup screen logo – Replace the logo.png files located in the resdrawable-XXX subfolders. o You need to provide logo files in different sizes corresponding to the device’s size. • Execution properties – Open the execution.properties file and change the execution values. o You need to define either the execution properties’ values or a URL referring to a file containing the execution properties’ values as defined above. o Leaving the URL property empty means that a dialog box will be opened and the end user will need to write the URL.After performing the desired changes, you need to compile the application and sign it.Follow these steps to compile and sign your custom application: 1. Create a keystore file. To sign your APK file, you first need to create a keystore with your own keys and certificates. (This only needs to be done once.) A test keystore is provided in the installation, so for testing purposes you can skip this stage and use the test keystore. For deployment it is recommended to create your own keystore. To create a keystore, we will use the keytool application installed with the Java SDK. Run the following command and follow the instructions and finalize the creation of your keystore: keytool -genkey -keystore my.keystore -alias mykey 2. Create a signed APK file. The compilation of the Android project is done using the Ant tool. The Ant tool is located in the %EngineDir%RIAModulesUtilsapache-ant-1.8.3 folder. • Navigate to the application source folder: %EngineDir%RIAModulesAndroidSource. • Run the following file: build.cmd. The build process creates an APK file named Dev-release.apk inside the project’s bin directory. Note: You can edit the build.cmd file in order to troubleshoot the build process. For example, to see the full actions, remove the -q from the command in the build.cmd file and to save the log to a file, add -l build.log to the command in the build.cmd file.That’s it; you can now take the Dev-release.apk file and install your application on your mobile device asdetailed above.For more information, you can refer to: http://developer.android.com/guide/publishing/preparing.html.iOSTo compile the code you need to install Xcode as defined in the iOS simulator section above and a validprovision profile signed with the app identifier (AppID). 21

This document covers ‘in-house’ packages (enterprise). ‘App store’ distribution is not covered in thisdocument.The source code for the iOS application is located at: %EngineDir%RIAModulesiOSSource.You can change the characteristics of the application in the settings.properties file as follows: • bundle.display.name – The application title as visible to the user. • build – An integer value that represents the version of the application code, relative to other versions. • version – A string value that represents the release version of the application code, as it should be shown to users. • bundle.identifier – The identifier of the project. The identifier must be unique across all packages installed on the iOS system.Note: When creating a provisioning file, the application identifier in the provisioning needs to be the same asthe value entered here. • target.name – The application title as visible in the AppStore. • developer.account.name – The name of the developer account in Apple (as shown in the Certificates screen in the Apple portal) prefixed by iPhone Distribution: or iPhone Developer: according to the provisioning type. For example, if the name of the certificate at the iOS provisioning portal is Magic Software Enterprises Ltd., then for the development certificate, the developer name is iPhone Developer: Magic Software Enterprises Ltd. and for the distribution certificate, the developer name is iPhone Distribution: Magic Software Enterprises Ltd.. • provisioning.profile.filename – This is the file that you download from the Apple developer portal after creating the provision. For example: Magic_distribution.mobileprovision.You can change the following files as well: • Icon – Replace the icons’ files in the source folder. The project contains three icons: o iPadIcon.png – A 72x72 pixels icon targeted for the iPad. o iPhoneIcon.png – A 57x57 pixels icon targeted for the iPhone up to 3GS and the iPod. o iPhoneRetinaIcon.png – A 114x114 pixels icon targeted for iPhone 4 and above. • Startup screen logo – Replace the default* images located in the source folder with your images. • Execution properties – Open the execution.properties file located in the MagicApp folder and change the execution values. o You need to define either the execution properties’ values or a URL referring to a file containing them as defined above. o Leaving the URL property empty means that a dialog box will be opened and the end user will need to write the URL.After making your changes, you need to compile the application and sign it. 22

Follow these steps to compile and sign your custom application: 1. Apple Developer program / certificates and provisioning profiles • You need a valid ‘iOS Developer Enterprise Program’ account or you need to join an existing account as a team member. Additional details can be found at: https://developer.apple.com/support/ios/enterprise.html • A Standard developer account can be used as well, but an application signed using a developer account can only be distributed using the Apple store or ad-hoc. • After registering you need to create a certificate for your account and download it to your Mac. Additional details can be found at: https://developer.apple.com/ios/manage/certificates/team/howto.

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Java User Group Switzerland: Event "RIA for Mobile Devices"

Going Mobile with JavaFX Script, Groovy and Google Android. SPEAKER: Dierk König COMPANY: Canoo Engineering AG. Since the 2007 JavaOne conference, the ...
Read more

RIA Mobile Solutions

Who we've helped. Our clients know they can trust RIA Mobile Solutions to deliver high-quality, professional software tailored to the needs of their ...
Read more

RIA for Mobile | Rich Interactive Applications for Mobile ...

Rich Interactive Applications for Mobile Devices ... 我想大部分學過 CSS 的人都知道, 當你設定一個值給 margin 時, 例如: #wrap{margin ...
Read more

Design tips for creating mobile websites | Adobe Developer ...

Progressively disclose. As with mobile application design, displaying the right amount of information at the right time is critical for mobile websites.
Read more

RIA’s revolution and Mobile Devices (Rant) | Alex Yakhnin ...

There’s been an explosion of the web and cloud related development tools and services such as Web 2.0, RIA’s, Silverlight, multiple cloud ...
Read more

RIA Mobile GIS - Mobile Desktop Asset Management Systems

These mobile GIS and GPS systems are map based and location aware so they work anywhere, any time, on any device. About RIA Mobile GIS . GIS Development.
Read more

Beginning Flash, Flex, and AIR Development for Mobile ...

Buy Beginning Flash, Flex, and AIR Development for Mobile Devices on Amazon.com FREE SHIPPING on qualified orders
Read more

Chapter 23: Designing Rich Internet Applications

Chapter 23: Designing Rich Internet Applications. For more details of the topics covered in this guide, ... RIAs work on mobile devices, ...
Read more

RIA Novosti – Windows Apps on Microsoft Store

Download this app from Microsoft Store for Windows 10 Mobile, Windows Phone 8.1, Windows Phone 8. See screenshots, read the latest customer reviews, and ...
Read more

Our Story - Chicago | RIA Workspace

Our Story About RIA WorkSpace. RIA WorkSpace was founded in 2007 by our President, David Kakish. RIA WorkSpace is a division of InhouseCIO with ...
Read more