Streamezzo S.A. - All rights reserved
Copyright 2001-2009
How to create a Client Package for Android
This tutorial details how to create a client package for an Android device using Streamezzo Workbench Developer, i.e. the provided client package creation wizard and the androidPackage Ant task.
Pre-requisites
You must install Streamezzo Android Mobile Package Creator (AMPC) application in order to support the creation fo client packages for Android devices in Streamezzo Workbench Developer.
See Android Mobile Package Creator Tutorial for its specific pre-requisites (especially note the default JRE must be in version 1.6 or higher).
Using the client package creation wizard
Creating the example service
After AMPC installation, go to Workbench Developer to create a new Service "MyFirstAndroidApplication" with a single client scene (welcome.rsp).

welcome.rsp source code:
- <Streamezzo>
- <header size="<%= userAgent.getScreenWidth()+" "+userAgent.getScreenHeight() %>" colorBits="8" lengthBits="16" resolution="2"
- idBits="16" scaleBits="15" encodingType="0" />
- <AUnit time="0">
- <Background color="1.0 1.0 1.0"/>
- <Insert>
- <Text string="Welcome to Android Platform" horizAlign="CENTERED" vertAlign="MIDDLE" size="MEDIUM" style="BOLD" />
- </Insert>
- </AUnit>
- </Streamezzo>
You can now create your client package using the wizard available from menu Service > Create Client Package. You then just have to follow the steps and the client package will be created in the specified folder.

Defining a client package creation ANT task
In Window > Show View > Other..., select Ant > Ant view.
In the Service Browser, create a new folder "ant" and add a new ANT file "build.xml" (from the Service Desk contextual menu select New > Other... > New ANT build file).

In this file, add the source code below then edit it (especially paths).
You can also rely on the previously used wizard to generate the Ant tasks: right-click in the "build.xml" file editor and select Wizards > Create client package target.
- <?xml version="1.0" encoding="UTF-8"?>
- <project name="project" default="default">
- <target name="default">
- <stz.client.package jdk="C:/jdk1.5.0_20" start="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/src/welcome.rsp">
- <serviceParameters>
- <serviceParameter name="adaptation.content.source" value="res/adaptation.xml" />
- </serviceParameters>
- <scenes>
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/src" includes="welcome.rsp" />
- </scenes>
- <resources>
- <dirset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication" includes="res" />
- </resources>
- <compilationLibraries>
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="adaptation.jar" />
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="com.streamezzo.odp.utils.jar" />
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="dom4j-1.6.1.jar" />
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="jaxen-1.1.1.jar" />
- </compilationLibraries>
- <runtimeLibraries>
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="adaptation.jar" />
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="com.streamezzo.odp.utils.jar" />
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="dom4j-1.6.1.jar" />
- <fileset dir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication/Components" includes="jaxen-1.1.1.jar" />
- </runtimeLibraries>
- <packages>
- <androidPackage packageId="android_dalvik_htc_g1" packageVersion="6.02.08-6.0.1" outputDir="C:/Documents and Settings/user/Mes documents/MyFirstAndroidApplication">
- <device brand="HTC" model="G1" packageID="android_dalvik_htc_g1" version="6.02.08-6.0.1" />
- </androidPackage>
- </packages>
- </stz.client.package>
- </target>
- </project>
Take care of setting:
- the property android.package value attribute to the path to the appropriate AMPC device package ZIP file
- stz.client.package jdk attribute to the path to your JDK folder

If an Android device is currently connected, the deployment on Android platform is automatically proposed at the end of the build process.
After deployment, just click on the "RichMedia" icon to launch the application.