Deployment on Symbian Devices

This document contains guidelines for deploying the mBS framework along with its basic bundles on a Symbian 7.0 mobile device, such as products compliant with Nokia Series 80 (like Nokia 9500 Communicator) or with UIQ 20 (like Sony Ericsson P800).

You can find useful guidelines in the documents "Target Deployment Guide" and "Platform Deployment Tips".

Basically, you can run an mBS image by simply importing the image files to the target platform by using a PC Suite or a MMC. The image files can be also conveniently packed in a .sis installation file.

Contents:


Series 80

Prepare the image

For convenience, you can dedicate a directory for modeling the Symbian Series 80 image of mBS. Of course, you can build a Symbian image of mBS straight from its full-content home directory.

Basically, such an image should contain:

Example Directory Structure

Using a ready storage in MMFS format
bin/vms domain.crp
/j9 server.j9
/storage
  • s80.prs
  • Config.class
lib serverj9.jar
Using a local base bundle directory
bin/vms domain.crp
/j9 server.j9
  • s80.prs
  • Config.class
symbian_boot.ini
bundles
  • osgilib.jar
  • putil.jar
  • <custom_bundle>
lib serverj9.jar

Example .j9 Launch File

Following is an example .j9 file, server.j9, containing most common options for launching the mBS framework. server.j9 assumes that the image is placed within the C:\osgi directory of device.

-cp C:\osgi\bin\vms\j9;C:\osgi\lib\serverj9.jar -Dmbs.output=remote -Xmns128K -Dmbs.boot.bootfile=C:\osgi\bin\vms\j9\s80_boot.ini -Dmbs.prs.name=C:\osgi\bin\vms\j9\s80.prs -Dmbs.domain.base=C:\osgi\bin\vms -Dmbs.storage.root=C:\osgi\bin\vms\j9\storage com.prosyst.mbs.impl.framework.Start
Listing 1.1: An example .j9 launch file.

Create a .sis file with makesis

For convenience, you can create a .sis (Symbian Installation System) file for easy installation of all image components on the device. Here, we'll describe the basic steps to create the image .sis file by using the makesis tool.

To create a .sis file, first you have to create a .pkg package file describing the installation procedure.

Use a ready package file

The Framework Professional Edition Package offers ready-to-use package files placed in the bin/vms/j9/sismake_symbian7.0s directory - fw_template.pkg and fw_emu_template.pkg. The first one is designed for Series 80 physical devices and the second one - for the Series 80 SDK. The resulting .sis file will place the image components in a directory called \mbs60. The image will contain:

Write an own package file

You can create your own package file as well - write it by hand or for example use the Sisar tool.

Following is an example .pkg package which contains instruction to take the image files from a certain directory on the development computer and on installation to extract them within the \osgi directory on the user-specified device drive.

&IE
#{"mBeddedServer"},(0x10000001),6,0,0,TYPE=SISAPP
;
(0x101F8ED2), 0, 0, 0, {"Series80ProductID"}
;
"D:\develop\symbian\s80\server_image\osgi\lib\serverj9.jar"-"!:\osgi\lib\serverj9.jar"
"D:\develop\symbian\s80\server_image\osgi\bin\vms\domain.crp"-"!:\osgi\bin\vms\domain.crp"
"D:\develop\symbian\s80\server_image\osgi\bin\vms\j9\server.j9"-"!:\osgi\bin\vms\j9\server.j9"
"D:\develop\symbian\s80\server_image\osgi\bin\vms\j9\s80_boot.ini"-"!:\osgi\bin\vms\j9\s80_boot.ini"
"D:\develop\symbian\s80\server_image\osgi\bin\vms\j9\jar.prs"-"!:\osgi\bin\vms\j9\jar.prs"
"D:\develop\symbian\s80\server_image\osgi\bundles\putil.jar"-"!:\osgi\bundles\putil.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\osgilib.jar"-"!:\osgi\bundles\osgilib.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\db.jar"-"!:\osgi\bundles\db.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\log.jar"-"!:\osgi\bundles\log.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\metatype.jar"-"!:\osgi\bundles\metatype.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\config.jar"-"!:\osgi\bundles\config.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\telnet.jar"-"!:\osgi\bundles\telnet.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\useradm.jar"-"!:\osgi\bundles\useradm.jar"
"D:\develop\symbian\s80\server_image\osgi\bundles\usradmex.jar"-"!:\osgi\bundles\usradmex.jar"
Listing 1.2: An example .pkg file.

Generate the .sis file

With the .pkg file ready, use makesis SDK tool or another utility (e.g. Sisar GUI tool) to create the .sis file from the .pkg one.

Transfer the image to the device

You have several options to transfer the image to the Series 80 device - as a standard directory or as a .sis archive.


Figure 1.1: An example image on a Series 80 device.

Directory

Connect the PC to the communicator over USB, Bluetooth or Infrared. Then, by using the Phone Browser of the Nokia PC Suite copy the image directory, e.g. osgi, to a directory within C:\, e.g. to C:\osgi.

.sis

As a result, the image components will be extracted to the directory on the user-defined drive, as specified in the .sis file.

Launch the image

The image can be started directly by opening a .j9 launch file on the device. In case you have used the shortcut files implemented by ProSyst, you can also use the MBS6.0 shortcut from the Communicator's Desk.

On success, the Communicator will start an application task.

Tip: By default, the Java standard output and error streams are available in the C:\logs\j9vm directory of the Series 80 device.


Figure 1.2: Launching the mBS image on a Series 80 platform.

Send commands to the image

Currently, the Series 80 devices does not have an I/O console in its default set of applications. You can use the Link Handler utility for sending commands to the image. Otherwise, you'll have to develop your own application to command the OSGi framework implementation.

For development purposes, over WLAN you can use a Telnet client to communicate with the mBS image at runtime.

To view the standard output on a remote host, again by using a WLAN you can use also the Remote Console. Currently, due to the constrained Java support on the device, you cannot provide input in this console.

You can also redirect the output to a text file on the local file system.


UIQ 20

Prepare the image

For convenience, you can dedicate a directory for modeling the Symbian UIQ 20 image of mBS. Of course, you can build a Symbian image of mBS straight from its full-content home directory.

Basically, such an image should contain:

Example Directory Structure

Using a ready storage in MMFS format
osgi bin/vms domain.crp
/erj server.j9
/storage
  • s80.prs
  • Config.class
lib serverjvm11.jar
system/apps/osgi
  • osgi.aif
  • osgi.app
  • osgi.txt
Using a local base bundle directory
osgi bin/vms domain.crp
/erj
  • uiq.prs
  • Config.class
uiqboot.ini
bundles
  • osgilib.jar
  • putil.jar
  • <custom_bundle>
lib serverjvm11.jar
system/apps/osgi
  • osgi.aif
  • osgi.app
  • osgi.txt

Create the image shortcut with AIF Builder

Optionally, you can generate a number of files to make the image startable from the UIQ Application Launcher.

Use a ready image shortcut

The Framework Professional Edition Package offers ready files for image shortcut in the Application Launcher. They are located in the lib/runtimes/symbian/7.0/system/apps/OSGiServer installation directory. The content of the lib/runtimes/symbian/7.0 subdirectory should be copied to the C:\ folder on the device. The ready shortcut expects that the mBS image is placed in the \mbs60 directory of the device.

Create an own image shortcut

You can use the UIQ SDK's AIF Builder to create the set of files needed for displaying the image in the application list (start the builder by using the <uiq_sdk_dir>/epoc32/tools/AIFBuilder script). On successful generation, the tool will create an .aif, an .app and a .txt. The last one contains the command options to the PersonalJava JVM - as a basis for the required command options, you can check the OSGiServer.txt script in the lib/runtimes/symbian/7.0/system/apps/OSGiServer directory. Some of the system properties can be also configured in the .txt launch file.

-cp C:\osgi\bin\vms\erj;C:\osgi\lib\serverpjava.jar -cd C:\osgi\bin\vms\erj -Djava.library.path=C:\System\libs -Dmbs.boot.bootfile=C:\osgi\bin\vms\erj\uiqboot.ini -Dmbs.prs.name=C:\osgi\bin\vms\erj\uiq.prs -Dmbs.domain.base=C:\osgi\bin\vms com.prosyst.mbs.impl.framework.Start
Listing 2.1: An example command line.

The .aif and .app files should be placed in a subdirectory of C:\system\apps, specially allocated for the mBS image, for example on the device the .aif and .app files can be placed in C:\system\apps\osgi.

Of course, you can use other tools for generating the set of components for display in the UIQ Application Launcher.

Create a .sis file

For convenience, you can create a .sis (Symbian Installation System) file for easy installation of all image components on the device. Here, we'll describe the basic steps to create the image .sis file by using the makesis tool.

To create a .sis file, first you have to create a .pkg package file describing the installation procedure.

Use a ready package file

The Framework Professional Edition Package offers ready-to-use package files placed in the bin/vms/pjee31/sismake_symbian7.0 directory - fw_template.pkg and fw_emu_template.pkg . The first one is designed for UIQ 20 physical devices and the second one - for the UIQ 20 SDK. The resulting .sis file will place the image components in a directory called \mbs60. The image will contain:

Write an own package file

You can write the package file by hand or for example use the Sisar tool.

Following is an example .pkg package which contains instruction to take the image files from a certain directory on the development computer and on installation to extract them within the \osgi directory on the user-specified device drive.

&IE
#{"mBeddedServer"},(0x10000001),6,0,0,TYPE=SISAPP
;
(0x101F617B), 2, 0, 0, {"UIQ20ProductID"}
"D:\develop\symbian\uiq\server_image\osgi\lib\serverpjava.jar"-"!:\osgi\lib\serverpjava.jar"
"D:\develop\symbian\uiq\server_image\osgi\bin\vms\domain.crp"-"!:\osgi\bin\vms\domain.crp"
"D:\develop\symbian\uiq\server_image\osgi\bin\vms\erj\uiqboot.ini"-"!:\osgi\bin\vms\erj\uiqboot.ini"
"D:\develop\symbian\uiq\server_image\osgi\bin\vms\erj\uiq.prs"-"!:\osgi\bin\vms\erj\uiq.prs"
"D:\develop\symbian\uiq\server_image\osgi\bundles\putil.jar"-"!:\osgi\bundles\putil.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\osgilib.jar"-"!:\osgi\bundles\osgilib.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\db.jar"-"!:\osgi\bundles\db.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\log.jar"-"!:\osgi\bundles\log.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\metatype.jar"-"!:\osgi\bundles\metatype.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\config.jar"-"!:\osgi\bundles\config.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\telnet.jar"-"!:\osgi\bundles\telnet.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\useradm.jar"-"!:\osgi\bundles\useradm.jar"
"D:\develop\symbian\uiq\server_image\osgi\bundles\usradmex.jar"-"!:\osgi\bundles\usradmex.jar"

"D:\develop\symbian\uiq\server_image\system\apps\osgi\osgi.aif"-"!:\system\apps\osgi\osgi.aif"
"D:\develop\symbian\uiq\server_image\system\apps\osgi\osgi.app"-"!:\system\apps\osgi\osgi.app"
"D:\develop\symbian\uiq\server_image\system\apps\osgi\osgi.txt"-"!:\system\apps\osgi\osgi.txt"
Listing 2.2: An example .pkg file.

Transfer the image to the device

Similarly to Series 80 platforms, you have several options to transfer the image to the UIQ device - as a standard directory or as a .sis archive.


Figure 2.1: An example image on a UIQ device.

Directory

Connect the PC to the device over USB, Bluetooth or Infrared. Then, by using the File Manager of the PC Suite copy the image directory, e.g. osgi, to a directory within C:\, e.g. to C:\osgi.

.sis

On success, the image components will be extracted to the directory on the user-defined drive, as specified in the .sis file.

Launch the image

The image can be started directly from the Application Launcher by selecting its icon (set in the .aif file) in the application list. In case you have used the shortcut files implemented by ProSyst, you can also use the MBS6.0 shortcut.

On success, the device will start an application task by passing the arguments from the .txt launch file to the PersonalJava JVM.


Figure 2.2: Launching the mBS image on a UIQ 20 platform.

Tip: As by default, when launched from the application list the Java standard output and error streams are lost, you can use I/O Redirector tool which captures these streams.

For the UIQ 20 SDK only, you can directly call the PersonalJava JVM of the UIQ SDK in the following way:

  1. Set the _epoc_drive_j environment variable to <sdk_home_dir>/epoc32/java.
  2. Call the pjava or pjava_g executable with proper arguments, as shown for the .txt launch file (Listing 2.1).

Send commands to the image

Currently, the UIQ 20 devices does not have an I/O console in its default set of applications. You can benefit from the Link Handler utility for sending commands to the image by means of link text files. Otherwise, you will have to develop your own application to administer the OSGi framework implementation and the image bundles.

For development purposes, over WLAN you can use a Telnet client to communicate with the mBS image at runtime.

To view the standard output on a remote host, again by using a WLAN you can use also the Remote Console. Currently, due to the constrained Java support on the device, you cannot provide input in this console.

You can also redirect the output to a text file on the local file system.


Sending commands to the image through link files

In some cases, it is not possible to send commands to the mBS framework running on a Symbian device. ProSyst offers a solution to this issue through the Link Handler utility. Next, you can read the command output either from a file or from a remote location.

In general, all you have to do is deploy the Link Handler utility on the OSGi-enabled Symbian device and create text files, which will hold text commands to the framework. The command text files should have the .link extension.

Link Handler Overview

The Link Handler consists of two separate modules - a native Symbian C++ module and an OSGi-compliant bundle with integrated native library.

The native module consists of two C applications - a MIME Recognizer for link files (link files are defined to be of MIME type "prosyst/link") and a handler application, called ProSyst Link Handler, for parsing the content of the .link files and sending the recognized commands to the bundle. In the mBS home directory, the native module comprises the following components:

The bundle participating in the Link Handler utility is called Link Executor and its JAR file is linkexec.jar from the bundles mBS directory. When activated on the framework, the bundle starts a command server for executing commands, received on native level from the Link Handler native module.

Deploy on the device

Install and start the Link Executor bundle on mBS

This can be done by including the linkexec.jar in the Symbian image as described in the preceding paragraphs. In a few words:

  1. Include the bundle JAR file in the boot INI file so that it is started at mBS startup.
  2. Include the bundle JAR file in the bundles directory of the image.
  3. (Optional) Build the image .sis file on the development PC.
  4. Transfer the image to the device either by directly copying the image content from your PC to the device, or by installing the image .sis file if available.

Deploy the native module of the Link Handler

The components of the native module (see the "Link Handler Overview" section) of the mBS installation should be copied on the device with the lib/runtimes/symbian/7.0*/<environment> directory mapped to the root folder of the device. For example, lib/runtimes/symbian/7.0*/armi/system/libs/mbscmdlib.dll on the PC should be copied to \system\libs\mbscmdlib.dll on the device.

You can do the file transfer manually or include the native module's directories and files in the .sis file.

Note: When reinstalling the Link Handler native module on an emulator (i.e. an SDK), especially when using a .sis file, after the uninstallation stop the emulator and delete the LINKREC.MDL file from the \system\recogs folder. Otherwise, during the re-installation, the emulator will deny access to the system.

Write link files

Link files have extension .link and should be placed in the local file system of the Symbian device. One link file can contain only exactly one command to mBS.

The first line of the link file should contain the special header "prosyst/link" and the second one - the command which the local mBS will execute. For example:

prosyst/link
config.setvalue mbs.log.pid filelength 64
Listing 3: An example link file.

Run link files

  1. Start mBS with the Link Executor bundle active. In this way, the command server will start listening for commands.
  2. Start the device file manager and open the target link file. As a result, the Symbian OS will call the native Link Handler module, which will check the file and will retrieve the command there.
  3. Check the output for the result of the command execution.


References


Deployment