Download Print this page

Siemens XT65 User Manual

Siemens cell phone accessories user manual.
Hide thumbs

Advertisement

s
Java User's Guide
Siemens Cellular Engines
Version:
12
DocId:
wm_java_usersguide_v12
Products:
TC65, AC65, AC75, XT65, XT75

Advertisement

   Also See for Siemens XT65

   Related Manuals for Siemens XT65

   Summary of Contents for Siemens XT65

  • Page 1

    Java User’s Guide Siemens Cellular Engines Version: DocId: wm_java_usersguide_v12 Products: TC65, AC65, AC75, XT65, XT75...

  • Page 2

    TION, LOSS OF BUSINESS INFORMATION OR DATA, OR OTHER PECUNIARY LOSS) ARISING OUT THE USE OF OR INABILITY TO USE THE DOCUMENTATION AND/OR PRODUCT, EVEN IF SIEMENS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE FOREGOING LIMITATIONS OF LIABILITY SHALL NOT APPLY IN CASE OF MANDATORY LIABILITY, E.G.

  • Page 3: Table Of Contents

    Preface ... 11 Overview ... 12 Related Documents ... 12 Terms and Abbreviations ... 13 Installation ... 15 System Requirements... 15 Installation CD for AC65/AC75 and XT65/XT75 ... 16 Installation CD for TC65... 17 3.3.1 Components... 18 3.3.1.1 3.3.1.2 3.3.1.3 3.3.1.4...

  • Page 4

    Java User’s Guide Content 4.2.8.3 Data Flow of a Java Application Running on the Module ... 32 Handling Interfaces and Data Service Resources ... 33 4.4.1 Module States ... 33 4.4.1.1 4.4.1.2 4.4.1.3 4.4.1.4 4.4.2 Module State Transitions ... 35 Maintenance ...

  • Page 5

    Java User’s Guide Content 5.12.3.4 Upload... 46 5.12.3.5 Download ... 47 5.13 System Time ... 49 MIDlets ... 50 MIDlet Documentation ... 50 MIDlet Life Cycle... 50 Hello World MIDlet ... 52 File Transfer to Module... 53 Module Exchange Suite ... 53 7.1.1 Windows Based ...

  • Page 6

    Java User’s Guide Content 11.3 Java IDE ... 75 11.3.1 NetBeans IDE 5.0, NetBeans 5.5 or NetBeans 5.5.x... 75 11.3.1.1 Switching Emulator to IMP-NG Emulator ... 76 11.3.1.2 Templates ... 77 11.3.1.3 Examples ... 78 11.3.1.4 Compile and Run ... 79 11.3.1.5 Starting Debug Session without Downloading Java Files ...

  • Page 7

    Java User’s Guide Content Java Tutorial ... 113 13.1 Using the AT Command API... 113 13.1.1 Class ATCommand... 113 13.1.1.1 Instantiation with or without CSD Support... 113 13.1.1.2 Sending an AT Command to the Device, the send() Method .. 13.1.1.3 Data Connections... 115 13.1.1.4 Synchronization...

  • Page 8

    Java User’s Guide Tables Tables Table 1: GPRS upload data rate with different number of timeslots, CS2 ... 46 Table 2: GPRS upload data rate with different number of timeslots, CS4 ... 46 Table 3: EDGE upload data rate with two timeslots, CS5... 46 Table 4: EDGE upload data rate with two timeslots, CS9...

  • Page 9

    Java User’s Guide Figures Figures Figure 1: Overview ... 12 Figure 2: Installation of Eclipse ME-Plugin 1.2.3: Dialog box Feature Updates ... 22 Figure 3: Installation of Eclipse ME-Plugin 1.2.3: Dialog box Updates sites to visit... 22 Figure 4: Installation of Eclipse ME-Plugin 1.2.3: dialog box Search Results ... 23 Figure 5: Installation of Eclipse ME-Plugin 1.2.3: dialog box Restart Eclipse ...

  • Page 10

    JBuilder - Runtime Configuration ... 93 Figure 54: JBuilder 2006 Enterprise/Developer – JDK settings ... 94 Figure 55: JBuilder 2006 Enterprise/Developer – Siemens Library ... 94 Figure 56: JBuilder 2006 Enterprise/Developer – Sample Projects ... 95 Figure 57: Emulator configuration file “switching Java System.out to serial port” ... 96 Figure 58: Using Windows Vista: Set Eclipse.exe perament to "Run as administrator"..

  • Page 11: Preface

    Java User’s Guide 1 Preface Preface This document covers the full range of IMP-NG Java products from Siemens, currently includ- ing: 1. TC65 Module 2. TC65 Terminal 3. AC75/AC65 Module 4. XT75/XT65 Module Differences between the products are noted in the particular chapters. Throughout the docu- ment, all supported products are referred to as ME (Mobile Equipment).

  • Page 12: Overview

    This document explains how to work with the ME, the installation CD and the tools provided on the installation CD. Related Documents List of documents referenced throughout this manual: AT Command Set of your Siemens Wireless product Hardware Interface Description of your Siemens Wireless product Java doc \wtk\doc\html\index.html IMP-NG, JSR228, Standard...

  • Page 13: Terms And Abbreviations

    Over The Air OTAP Over The Air Provisioning of Java Applications Packet Data Protocol Protocol Data Unit Standard Development Kit Short Message Service SMTK Siemens Mobile Toolkit Transfer Control Protocol Unsolicited Result Code wm_java_usersguide_v12 Confidential / Released Page 13 of 123 2008-02-25...

  • Page 14

    Java User’s Guide 2.2 Terms and Abbreviations Abbreviation Description Universal Resource Locator Visual Basic Script Wireless Toolkit wm_java_usersguide_v12 Confidential / Released Page 14 of 123 2008-02-25...

  • Page 15: Installation

    If you wish to access the module via USB ensure that the USB cable is plugged between the module’s USB interface and the PC. Unless already done, install the appropriate USB modem driver. To do so, use the "usbmodem.inf" file supplied with your Siemens module. Supported only for TC65...

  • Page 16: Installation Cd For Ac65/ac75 And Xt65/xt75

    Some of the content can only be accessed after the installation. EclipseME plugin 1.2.1 is also supported, but not distributed as part of the CD. EclipseME plugin 1.5.0 is supported by TC65, XT65/XT75 and AC65/AC75. It is distributed as part of the installation CD.

  • Page 17: Installation Cd For Tc65

    Java User’s Guide 3.3 Installation CD for TC65 Installation CD for TC65 The Siemens Mobility Toolkit Installation CD includes: • Module Exchange Suite (MES setup is distributed on CD under "MES\Setup.exe") • WTK (is distributed as zip file on the CD e.g. "WTK\tc65_wtk.zip")

  • Page 18: Components

    WTK is the directory where all the necessary components for product specific Java application creation and debugging are stored. The version of the installed WTK is stored under the root of the WTK directory in a text file. (e.g. C:\Program Files\Siemens\SMTK\<product name>\WTK\VersionWTK.txt) wm_java_usersguide_v12 Confidential / Released →...

  • Page 19: Sdk / Jdk

    Java User’s Guide 3.3 Installation CD for TC65 3.3.1.3 SDK / JDK This is software provided by SUN to support Java application development. SMTK emulator uses the following JDK (stored in JavaSoft Registry key) for starting the Debug Agent: • Registry path: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.4 HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.5...

  • Page 20: Eclipse 3.1.2 Ide And Eclipse Me Plugin 1.5.x

    The integration of SMTK into Eclipse with ME Plugin 1.5.0 is supported by the TC65, XT65/XT75 and AC65/AC75 CDs. Eclipse ME Plugin 1.5.5 is only distributed on TC65 CD. The installed Eclipse Version and ME Plugin can be read out after starting Eclipse and selecting: →...

  • Page 21: Gps Evaluation Software

    Java User’s Guide 3.3 Installation CD for TC65 3.3.1.8 GPS Evaluation Software The GPS Evaluation Software (u-center) was developed by u-blox AG, Switzerland. This soft- ware demonstrates the capabilities of global positioning system (GPS) part incorporated in the XT75 module. The latest version of the GPS Evaluation Software (u-center) can be downloaded for free from the internet: http://www.u-blox.com/products/u_center.html.

  • Page 22: Set Up Java Development Environment With Eclipse Ide (quick Start-up)

    Java User’s Guide 3.4 Set up Java Development Environment with Eclipse IDE (Quick Start-up) Set up Java Development Environment with Eclipse IDE (Quick Start-up) Please complete the following steps to set up your Eclipse Java development environment: Step 1: Install JDK 1.4.2_09 →...

  • Page 23: Figure 4: Installation Of Eclipse Me-plugin 1.2.3: Dialog Box Search Results

    MES transfer (downloading the MIDlet to the module): a) Standard 19200 Modem: Choose the COM port and set the baud rate (e.g. 115200). b) USB modem: Select "Siemens AG WM USB Modem". Note that the USB modem has to be installed previously using Siemens "usbmodem.inf" file.

  • Page 24: Siemens Mobility Toolkit Installation

    The JDK version 1.5.0_07 is provided and required for 2. Once the toolkit has been installed, the environment variable “path” can be altered to com- fortably use the JDK tools. This is not necessary for using the Siemens SMTK. 3. Open the Control Panel: - Open System.

  • Page 25

    (the connection will be available after the entire installation of the SMTK environment). - If a Dial-up Network connection named "IP connection for remote debugging" is already available for another Siemens IMP-NG product, you can choose to reconfigure the exist- ing connection by pressing Yes or leave it unchanged by pressing No.

  • Page 26: Installing Netbeans Ide 5.0 / Netbeans Ide 5.5.1

    Note: Only one selection for an Eclipse version at a time for SMTK integration is possible. Eclipse ME Plugin 1.2.3 is not provided on TC65 CD. Eclipse ME Plugin 1.5.0 is supported on the TC65, XT65/XT75 and AC65/AC75 CDs. "\EclipseME_WM" CD directory is not included on TC65 CD.

  • Page 27: Installing Borland Jbuilder X, 2005 And 2006 Enterprise/developer

    Windows Control Panel, double-click Add or Remove Programs, select “TC65 Software Development Kit”, press the Change/Remove button and select Repair. In the same manner, reinstall the Siemens Module Exchange Suite (MES)" As an alternative, to avoid this step, remove the TC45 package, before installing TC65 SDK and MES.

  • Page 28: Software Platform

    Java User’s Guide 4 Software Platform Software Platform In this chapter, we discuss the software architecture of the SMTK and the interfaces to it. Software Architecture The SMTK enables a customer to develop a Java application on a PC and have it be execut- able on the Java enabled module.

  • Page 29: Interfaces

    Java User’s Guide 4.2 Interfaces Interfaces 4.2.1 ASC0 - Serial Device ASC0, an Asynchronous Serial Controller, is a 9-wire serial interface. It is described in [2]. With- out a running Java application the module can be controlled by sending AT commands over ASC0.

  • Page 30: Gps

    One of the examples that come with the product CD is a tracking application that uses the Java location API. GPS is only supported in XT75/XT65. Products with GPS do not feature ASC1. So System.out is set to “null” device by default (see Section 5.9).

  • Page 31: Jvm Interfaces

    Java ME, CLDC and MIDP were implemented by SUN. IMP-NG is a stripped down version of MIDP 2.0 prepared by Siemens and does not include the graphical interface LCDUI. Siemens developed additional APIs like the File I/O and the AT command API. Documentation for Java ME and CLDC can be found at http://java.sun.com/javame/.

  • Page 32: Data Flow Of A Java Application Running On The Module

    Java User’s Guide 4.3 Data Flow of a Java Application Running on the Module Data Flow of a Java Application Running on the Module Figure 7: Data flow of a Java application running on the module. The diagram shows the data flow of a Java application running on the module. The data flow of a Java application running in the debug environment can be found in The compiled Java applications are stored as JAR files in the Flash File System of module.

  • Page 33: Handling Interfaces And Data Service Resources

    Java User’s Guide 4.4 Handling Interfaces and Data Service Resources Handling Interfaces and Data Service Resources To develop Java applications the developer must know which resources, data services and hardware access are available. • There are multiple AT parsers available •...

  • Page 34: State 2: No Java Running, General Purpose I/o And I2c/spi

    Java User’s Guide 4.4 Handling Interfaces and Data Service Resources 4.4.1.2 State 2: No Java Running, General Purpose I/O and I2C/ The Java application is inactive. There is an AT parser with CSD on ASC0 as well as ASC1. Up to ten I/O pins are used as general purpose I/O plus a I2C/SPI interface. The pins are con- figured by AT^SCPIN and AT^SSPI (refer [1]).

  • Page 35: Module State Transitions

    Java User’s Guide 4.4 Handling Interfaces and Data Service Resources 4.4.2 Module State Transitions Figure 12: Module State Transition Diagram Note: No AT parser is available over serial interface ASC0 or ASC1 while a Java application is running on the module. wm_java_usersguide_v12 Page 35 of 123 2008-02-25...

  • Page 36: Maintenance

    Java User’s Guide 5 Maintenance Maintenance The basic maintenance features of the ME are described below. Explicit details of these func- tions and modes can be found in IP Service Apart from the standard Java IP networking interfaces (UDPDatagramConnection, SocketCon- nection, ...) the ME also supports a set of Internet Services controlled by AT command.

  • Page 37: Remote Sim Access

    Java User’s Guide 5.2 Remote SIM Access Remote SIM Access While Remote SIM Access (RSA) is normally closely coupled with the GSM 07.10 multiplexer there are some things to keep in mind when using it with Java. • Java must not be started when RSA and/or the GSM 07.10 multiplexer is activated. •...

  • Page 38: Charging

    Java User’s Guide 5.4 Charging Charging Please refer to for general information about charging. Charging can be monitored by the running Java application. The JVM is active in Charge mode and in Charge-Only mode if autostart is activated. Only a limited number of AT commands are available when the module is in Charge-Only mode.

  • Page 39: Shutdown

    Java User’s Guide 5.7 Shutdown Shutdown If an unexpected shutdown occurs, data scheduled to be written will get lost due to a buffered write access to the flash file system. The best and safest approach to powering down the mod- ule is to issue the AT^SMSO command.

  • Page 40: Special At Command Set For Java Applications

    Java User’s Guide 5.8 Special AT Command Set for Java Applications Special AT Command Set for Java Applications For the full AT command set refer to [1]. There are differences in the behaviour AT commands issued from a Java application in comparison to AT commands issued over a serial interface. 5.8.1 Switching from Data Mode to Command Mode Cancellation of the data flow with “+++”...

  • Page 41: Java Commands

    Java User’s Guide 5.9 System Out 5.8.5 Java Commands There is a small set of special Java AT commands: • AT^SJRA, start a Java application • AT^SJNET, configuration of Java networking connections • AT^SJOTAP, start and configuration of over the air provisioning •...

  • Page 42: File

    Java User’s Guide 5.10 GPIO 5.9.2 File The System.out print can be redirected into log files within the module’s flash file system. The output will be written alternatingly into two files which can be concatenated afterwards to have a single log file. Writing the output to a file will slow down the virtual machine.

  • Page 43: Performance

    Java User’s Guide 5.12 Performance 5.12 Performance The performance study was focused on comparable performance values under various circum- stances. 5.12.1 Java This section gives information about the Java command execution throughput (“jPS”= Java statements per second). The scope of this measurement is only the statement execution time, not the execution delay (Java command on AT interface tion on GPIO).

  • Page 44: Pin I/o

    For details about the software platform and interfaces refer to This section summarises limitations and preconditions for performance when using the inter- face CommConnection from package com.siemens.mp.io (refer to [3]). The data rate on RS232 depends on the size of the buffer used for reading from and writing to the serial interface.

  • Page 45: Plain Serial Interface

    Java User’s Guide 5.12 Performance 5.12.3.1 Plain Serial Interface Scenario: A device is connected to ASC0 (refer to handle data input and output streams. A simple Java application (with only one thread) which loops incoming data directly to output, reaches data rates up to 180kbit/s. Test conditions: hardware flow control enabled (<autorts>...

  • Page 46: Upload

    Java User’s Guide 5.12 Performance 5.12.3.4 Upload The ME supports up to four uplink time slots for GPRS and up to two for EGDE. The Java appli- cation receives data over RS232 API and sends them over GPRS to a server. Table 1: GPRS upload data rate with different number of timeslots, CS2 Upload data rate with x timeslots Coding scheme 2...

  • Page 47: Download

    Java User’s Guide 5.12 Performance Figure 17: Scenario for testing data rates on ASC1 with GPRS data upload 5.12.3.5 Download The data rate for downloading data over GPRS/EDGE depends on the number of assigned timeslots and the coding schemes given by the net. The ME supports up to four downlink time slots.

  • Page 48: Table 5: Gprs Download Data Rate With Different Number Of Timeslots, Cs2

    Java User’s Guide 5.12 Performance The tables below show the download data rates that can be achieved if hardware flow control is enabled on the CommConnection interface and the port speed is set to 460800. Table 5: GPRS Download data rate with different number of timeslots, CS2 Download data rate with x timeslots Coding scheme 2 [kbit/s]...

  • Page 49: System Time

    Java User’s Guide 5.13 System Time 5.13 System Time When Java starts up, it initializes its time base from the system’s real time clock. If the RTC is changed by AT command (AT+CCLK) later on, the Java time does not adjust. So, the time you get with (AT+CCLK) and the time you get with System.currentTimeMilis() may not necessarily be identical.

  • Page 50: Midlets

    MIDlet Documentation MIDP and MIDlet documentation can be found at html document directory of the wtk, …\Siemens\SMTK\<productname>\wtk\doc\index.html MIDlet Life Cycle The MIDlet life cycle defines the protocol between a MIDlet and its environment through a sim- ple well-defined state machine, a concise definition of the MIDlet’s states and APIs to signal changes between the states.

  • Page 51: Table 9: A Typical Sequence Of Midlet Execution

    Java User’s Guide 6.2 MIDlet Life Cycle • notifyDestroyed() – the MIDlet notifies the application management software that it has cleaned up and is done. Note: the only way to terminate a MIDlet is to call notifyDestroyed(), but destroyApp() is not automatically called by notifyDestroyed().

  • Page 52: Hello World Midlet

    Java User’s Guide 6.3 Hello World MIDlet Hello World MIDlet Here is a sample HelloWorld program. * HelloWorld.java package example.helloworld; import javax.microedition.midlet.*; import java.io.*; public class HelloWorld extends MIDlet { * HelloWorld - default constructor public HelloWorld() { System.out.println("HelloWorld: Constructor"); * startApp() public void startApp() throws MIDletStateChangeException { System.out.println("HelloWorld: startApp");...

  • Page 53: File Transfer To Module

    Java User’s Guide 7 File Transfer to Module File Transfer to Module Module Exchange Suite The Module Exchange Suite allows you to view the Flash file system on the module as a direc- tory from Windows Explorer. Make sure that the module is turned on and that one of the mod- ule’s serial interfaces (ASC0, ASC1 or USB) is connected to the COM port that the Module Exchange Suite is configured to.

  • Page 54: Security Issues

    Java User’s Guide 7.3 Security Issues Security Issues The developer should be aware of the following security issues. Security aspects in general are discussed in Chapter 7.3.1 Module Exchange Suite The serial interface should be mechanically protected. The copy protection rules for Java applications prevent opening, reading, copying, moving or renaming of JAR files.

  • Page 55: Over The Air Provisioning (otap)

    Java User’s Guide 8 Over The Air Provisioning (OTAP) Over The Air Provisioning (OTAP) Introduction to OTAP OTA (Over The Air) Provisioning of Java Applications is a common practice in the Java world. OTAP describes mechanisms to install, update and delete Java applications over the air. The ME implements the Over The Air Application Provisioning as specified in the IMP-NG standard (JSR228).

  • Page 56: Otap Parameters

    Java User’s Guide 8.3 OTAP Parameters OTAP Parameters There is a set of parameters that control the OTAP procedures. These parameters can either be set by AT command (AT^SJOTAP, refer to (see Section 8.4) during operation of the device in the field. None of the parameters, which are set by AT command, can be overwritten by SM.

  • Page 57: Short Message Format

    Java User’s Guide 8.4 Short Message Format Table 10: Parameters and keywords Parameters Max. Length AT Ignore SM PID Hide HTTP authentica- tion parameters The length of the string parameters in the AT command is limited (see the SM is only limited by the maximum SM length. The minimum set of required parameters depends on the intended operation (see “optional/P”...

  • Page 58: Java File Format

    Java User’s Guide 8.5 Java File Format The values of APPDIR, BEARER and START are used internally and must be lower case. The password (PWD) is case sensitive. The case sensitivity of the other parameter values depends on the server application or the network. It is likely that not all parameters can be sent in one SM.

  • Page 59: Procedures

    Java User’s Guide 8.6 Procedures A suitable Manifest file for the JAD file above might look like: Manifest-Version: 1.0 MIDlet-Name: MyTest MIDlet-Version: 1.0.1 MIDlet-Vendor: TLR Inc. MIDlet-1: MyTest, , example.mytest.MyTest MicroEdition-Profile: IMP-NG MicroEdition-Configuration: CLDC-1.1 Procedures 8.6.1 Install/Update Figure 20: OTAP: Install/Update Information Flow (messages in brackets are optional) When an SM with keyword START:install is received and there is a valid parameter set for the operation, the module always reboots either when the operation completed, an error occurred or the safety timer expired.

  • Page 60: Delete

    Java User’s Guide 8.6 Procedures the old and the new application at the same time, the old application is deleted before the down- load of the new one, therefore it is lost when an error occurs.If install/update was successful, autostart is set to the new application. 8.6.2 Delete Figure 21: OTAP: Delete Information Flow (messages in brackets are optional)

  • Page 61: Time Out Values And Result Codes

    Java User’s Guide 8.7 Time Out Values and Result Codes Time Out Values and Result Codes Timeouts: • Closedown Timeout: 10 seconds • Safety Timeout: 10 minutes Result Codes: Supported status codes in body of the http POST request: • 900 Success •...

  • Page 62: Otap Tracer

    Java User’s Guide 8.9 OTAP Tracer OTAP Tracer For easy debugging of the OTAP scenario, the OTAP procedure can be traced over the serial interface. The trace output shows details of the OTAP procedure and the used parameters. To enable the OTAP trace output use the AT command AT^SCFG, e.g. AT^SCFG=Trace/Syslog/OTAP,1 The serial interface on which you issue this command is then exclusively used for the OTAP tracer.

  • Page 63

    Java User’s Guide 8.11 How To device reboots. You can now check the content of the file system and if the correct jar and jad files were loaded into the correct location. 8. Analyze errors. If the above test failed, looking at your device’s behavior and your http serv- ers access log can give you a hint as to what went wrong: - Ιf the device did not terminate the running Java application and did not reboot, not even after the safety timeout, either your SM was not understood (probably in the wrong for-...

  • Page 64: Compile And Run A Program Without A Java Ide

    MyTest extends MIDlet includes at least: Manifest-Version: 1.0 MIDlet-Name: MyTest MIDlet-Version: 1.0.1 MIDlet-Vendor: Siemens MIDlet-1: MyTest, example.mytest.MyTest MicroEdition-Profile: IMP-NG MicroEdition-Configuration: CLDC-1.1 A JAD file must be written by the developer and must include at least: MIDlet-Name: MyTest MIDlet-Version: 1.0.1...

  • Page 65: Compile

    IMPNG_JDK_DIR and IMPNG_DIR. IMPNG_JDK_DIR points to the root directory of the installed JDK and IMPNG_DIR points to the root directory of the Siemens-SMTK-<product- name>-IMPNG installation. The installation process sets these environment variables. A mod- ification is usually not necessary.

  • Page 66: Run On The Module With Autostart

    Java User’s Guide 9.4 Run on the Module with Autostart Run on the Module with Autostart • Compile the application at the prompt as discussed in IDE. • Transfer the .jar and .jad file from the development platform to the desired directory on the module using the Module Exchange Suite or OTA provisioning.

  • Page 67: Compile And Run A Program With A Java Ide

    Java User’s Guide 10 Compile and Run a Program with a Java IDE Compile and Run a Program with a Java IDE 10.1 Eclipse 3.1.2 (with ME Plugin 1.2.3) The following description assumes that Eclipse 3.1.2 is installed from SMTK CD as described Section 3.3.1.6 10.1.1 Setup a New Project...

  • Page 68: Figure 24: Create New Eclipse Project: Midlet Suite Properties

    Java User’s Guide 10.1 Eclipse 3.1.2 (with ME Plugin 1.2.3) - Select e.g. TC65 Release 2 emulator: Figure 24: Create new Eclipse project: Midlet Suite Properties - A new Java Project has been created: Figure 25: Create new Eclipse project: work area with new created project wm_java_usersguide_v12 Confidential / Released Page 68 of 123...

  • Page 69: Figure 26: Create New Eclipse Project: Create A J2me Midlet

    Java User’s Guide 10.1 Eclipse 3.1.2 (with ME Plugin 1.2.3) - Select “Project01” and press <Ctrl+N> and select “J2ME Midlet”: Figure 26: Create new Eclipse project: Create a J2ME Midlet - Fill in Midlet parameters (package directory, name of Java source file) and press <Fin- ish>: Figure 27: Create new Eclipse project: Create a New J2ME Midlet wm_java_usersguide_v12...

  • Page 70: Figure 28: Create New Eclipse Project: Edit Some Java Commands

    Java User’s Guide 10.1 Eclipse 3.1.2 (with ME Plugin 1.2.3) Step 2: Modify Java source file “printme.java” template: Figure 28: Create new Eclipse project: Edit some Java commands This application prints the given line via ASC1 (default setting). Please keep in mind to add “notifyDestroyed();”...

  • Page 71

    Java User’s Guide 10.1 Eclipse 3.1.2 (with ME Plugin 1.2.3) Step 4: Create Jad and Jar file: - Select “Project01” - Open context menu of “Project01” and select Create Package from item J2ME - Jad and Jar file are be created under the “deployed” directory (default setting of Eclipse) Step 5: Download Jad and Jar file into the Flash File System of the module and start the Java appli- cation:...

  • Page 72: Debug Environment

    Java User’s Guide 11 Debug Environment Debug Environment 11.1 Data Flow of a Java Application in the Debug Environment Figure 30: Data flow of a Java application in the debug environment In the debug environment the module is connected to a PC via a serial interface. This can be a USB or an RS232 line.

  • Page 73: Emulator

    Note: For TC65 the file "WM_Debug_config.ini" is stored under the "Application Data" folder of the currently logged in user. Depending on the Windows operation system it can be found under the following directory: Windows 2000: e.g. "c:\Documents and Settings\<your login>\Application Data\ Siemens\SMTK\TC65_R3\WM_Debug_Config.ini" Windows XP: e.g. "c:\Documents and Settings\<your login>\Application Data\ Siemens\SMTK\TC65_R3\WM_Debug_Config.ini" Windows Vista: e.g.

  • Page 74

    Java User’s Guide 11.2 Emulator needs some seconds to enable the USB port once again after the "IP connection for remote debugging" is closed. If necessary, the IP addresses used for the debug connection can also be changed. This is done in the file "WM_Debug_config.ini".

  • Page 75: Java Ide

    JAR files used in the module must be configured according to the batch file examples given. If the SMTK install succeeded, you can easily switch between the Siemens environment and Standard-JDK environment, the special libraries/APIs and emulators are available, and AT commands can be sent to the module.

  • Page 76: Switching Emulator To Imp-ng Emulator

    Switching Emulator to IMP-NG Emulator You can switch to the SMTK emulator project dependent using the context menu for project properties (e.g. "Hello Sample" <properties>) and select the emulator platform and the device e.g. “Siemens IMP-NG TC65 R2 Wireless Toolkit” and “IMP_NG_TC65_R2” for TC65 Release 2.

  • Page 77: Templates

    Java User’s Guide 11.3 Java IDE 11.3.1.2 Templates Templates for a Siemens MIDlet can be found in the file explorer and under NetBeans IDE 5.0 → menu File New File... The MIDlet template provides the skeleton of an IMP-NG MIDlet appli- cation.

  • Page 78: Examples

    Java User’s Guide 11.3 Java IDE 11.3.1.3 Examples There are three IMP-NG MIDlet sample projects (“HelloSample”, “NetDemo” and “RS232Sample”) included. Each sample project can be selected directly in NetBeans IDE 5.0. You can open the sample project (e.g. “HelloSample”) using the NetBeans IDE 5.0 menu File →...

  • Page 79: Compile And Run

    Java User’s Guide 11.3 Java IDE 11.3.1.4 Compile and Run Ensure that the proper emulator will be used and compile the project as normal. Any output will be shown in the output window in the IDE together with some debugging information of the IDE. The html help files of the SMTK can be accessed directly by pressing Alt+F1.

  • Page 80: Displaying Java "system.out" In Netbeans Ide Window

    Java User’s Guide 11.3 Java IDE 11.3.1.6 Displaying Java "System.out" in NetBeans IDE window Please prepare redirection of Java “System.out” during a debugging session as described in Section 11.5 Switching Java “System.out” to IDE debug window. The Debugging Console tab of the NetBeans IDE window is selected by default after starting the debugging session.

  • Page 81: Eclipse 3.0 And Eclipse 3.1

    Java User’s Guide 11.3 Java IDE 11.3.2 Eclipse 3.0 and Eclipse 3.1 We recommend that Eclipse 3.0.1 or higher is to be used. 11.3.2.1 Eclipse 3.0 Please use the customized Eclipse ME Plugin version that is distributed with the SMTK CD under the directory “EclipseMEplugin_WM”...

  • Page 82: Using Eclipse With Me Plugin Up To Version 1.2.3

    Java User’s Guide 11.3 Java IDE 11.3.2.4 Using Eclipse with ME Plugin up to Version 1.2.3 11.3.2.4.1 Additional Configuration of Integrated Emulator The following configuration is displayed after SMTK integration into Eclipse by using the → Eclipse menu Windows Preferences Figure 38: Eclipse –...

  • Page 83: Using Eclipse With Me Plugin 1.5.x

    11.3.2.5 Using Eclipse with ME Plugin 1.5.x Eclipse ME Plugin 1.5.x is supported by the TC65, XT65/XT75 and AC65/AC75 CDs. This Eclipse ME Plugin is using a completely new device management concept to integrate different emulators. The integration and disintegration of the TC65 resp. XT65/XT75 or AC65/AC75 emulator is only automatically possible by using the TC65 resp.

  • Page 84: Figure 40: Eclipse With Me Plugin 1.5.0 - Display Of Different Integrated Emulators

    Java User’s Guide 11.3 Java IDE 11.3.2.5.1 Additional Configuration of Integrated Emulator The following configuration is displayed after SMTK integration into Eclipse by using the → → → Eclipse menu Windows Preferences J2ME Device Management: Figure 40: Eclipse with ME Plugin 1.5.0 – Display of different integrated emulators To use the debugger it is necessary to increase the debug server delay timeout of Eclipse IDE.

  • Page 85: Using Eclipse With Me Plugin 1.6.x

    You can easily switch between different installed emulators by using the properties of a project and choosing a Device Group, e.g. "Siemens IMP-NG XT75 Wireless Toolkit". You can select a device also by using the Manage Devices… button, see figure below.

  • Page 86: Import Example

    Java User’s Guide 11.3 Java IDE 11.3.2.7 Import Example You can import an existing Eclipse project using the following steps: → - Open menu: File Import - Choose the root directory of the Eclipse project (e.g. “Hello World” example of the SMTK CD).

  • Page 87: Compile And Debug

    Java User’s Guide 11.3 Java IDE 11.3.2.8 Compile and Debug To build the jar and jad files you have rebuild the project with the Create Package function. → Open the context menu of the project and go to J2ME Create Package. Figure 44: Eclipse –...

  • Page 88: Figure 45: Eclipse - Configuration

    Java User’s Guide 11.3 Java IDE Restriction: The integration of the SMTK using the SMTK installer depends selecting the offered default workspace “\workspace” of Eclipse (e.g. Eclipse 3.0.1 and 3.0.2 “..\eclipse\workspace\..” or Eclipse 3.1.0, 3.1.1 and 3.1.2 “..\Documents and Settings\<user name>\workspace\..”). If you like to use the SMTK integration inside other workspaces, please integrate SMTK man- ually in these workspaces using Eclipse menu Window Components (as shown in...

  • Page 89: Starting Debug Session Without Downloading Java Files

    Java User’s Guide 11.3 Java IDE 11.3.2.9 Starting Debug Session without Downloading Java Files It is possible to start a debugging session without download of the Java files (*.jad and *.jar) again. The emulator has to be started with an additional parameter “-noload” and downloading of the Java files is suppressed.

  • Page 90: Figure 47: Eclipse 3.2.x Me1.5.x And 1.6.x Select System Java Thread For Showing Breakpoint Line In Java Source

    Java User’s Guide 11.3 Java IDE Note for using Eclipse 3.2.x ME 1.5.x and 1.6.x: During debugging it is sometimes possible, that if a breakpoint is reached, the Java program stops, but no breakpoint is indicated in the Java source line (Java source windows). In this case please select the Java Thread in the "Debug"...

  • Page 91: Borland Jbuilder X

    The libraries included with the SMTK can be examined by opening the menu → Tools Configure Libraries… (see Figure below). wm_java_usersguide_v12 Confidential / Released Figure 48: JBuilder X – JDK settings Figure 49: JBuilder X – Siemens Library Page 91 of 123 2008-02-25...

  • Page 92: Examples

    Java User’s Guide 11.3 Java IDE 11.3.3.1 Examples There are sample projects provided with the SMTK. These projects can be found in the JBuild- erSamples directory of the SMTK installation directory. This directory is accessed by opening → a project using the menu File Open Project…...

  • Page 93: Starting Debug Session Without Downloading Java Files

    Java User’s Guide 11.3 Java IDE 11.3.3.2 Starting Debug Session without Downloading Java Files It is possible to start a debugging session without download of the Java files (*.jad and *.jar) again. The emulator has to be started with an additional parameter “-noload” and downloading of the Java files is suppressed.

  • Page 94: Borland Jbuilder 2005 And Jbuilder 2006 Enterprise/developer

    Figure 54: JBuilder 2006 Enterprise/Developer – JDK settings The libraries included with the SMTK can be examined by opening the menu Tools → Libraries… (see Figure below). Figure 55: JBuilder 2006 Enterprise/Developer – Siemens Library wm_java_usersguide_v12 Confidential / Released →...

  • Page 95: Examples

    Java User’s Guide 11.4 Breakpoints 11.3.4.1 Examples There are sample projects provided with the SMTK. These projects can be found in the JBuild- erSamples directory of the SMTK installation directory. This directory is accessed by opening → a project using the menu File Open Project…...

  • Page 96: Switching Java "system.out" To Ide Debug Window

    Java User’s Guide 11.5 Switching Java “System.out” to IDE Debug Window 11.5 Switching Java “System.out” to IDE Debug Window The Java “System.out” can be redirected during a debugging session using a UDP socket con- nection as described in Section 5.9 “System Out”...

  • Page 97: Important Information For Java Debugging On Windows Vista

    Java User’s Guide 11.6 Important Information for Java Debugging on Windows Vista 11.6 Important Information for Java Debugging on Windows Vista This section applies only to TC65. Java Debugging on Windows Vista requires that administrator privileges be set. To do so, fol- low these steps: 1.

  • Page 98: Java Security

    This feature makes it possible for MIDlets to use safe data links to external communications partners. The specification IMP-NG defines two java classes with this characteristic - HTTPS- Connection and SecureConnection The Siemens implementation follows the recommendations in IMP-NG: HTTPSConnection •...

  • Page 99: Figure 59: Mode 1 - Customer Root Certificate Does Not Exist

    Java User’s Guide 12.1 Secure Data Transfer Two modes exist for safe data links. Mode 1: • No examination of the server certificate takes place when setting up the connection. The authenticity of the server certificate is not verified. See Figure 59: Mode 1 –...

  • Page 100: Create A Secure Data Transfer Environment Step By Step

    Java User’s Guide 12.1 Secure Data Transfer Figure 61: Mode 2 - Server Certificate and self signed root Certificate in module form a chain 12.1.1 Create a Secure Data Transfer Environment Step by Step The following steps describe the configuration: •...

  • Page 101

    Java User’s Guide 12.1 Secure Data Transfer 1. Create CA and generate CA Root Certificate - We need certificates with sha1 signature. Java Security supports a sha1 signature of the certificate only. Add the parameter "-sha1" to the command "Making CA certificate ..." in the section of file CA.pl (cygwin location \cygwin\usr\ssl\misc”) - Create a shell (use location \cygwin\usr\ssl\misc) - Execute commands...

  • Page 102

    Java User’s Guide 12.1 Secure Data Transfer 5. Import CA root certificate and CA private key into java keystore - Use the CA Root Certificate for the creation of Java Security Command. See 12.5.3. - Execute command >java -jar setprivatekey.jar -alias dummyca -storepass keystorepass -keystore customer.ks -keypass cakeypass -keyfile ./democa/private/cakey.der -certfile ./democa/cacert.der...

  • Page 103: Execution Control

    - HTTP-Connection is permitted - TCP/IP-Socket Connection is permitted Standard behavior of the module: Siemens supplies modules with unsecured mode as the default configuration. Insert the certificate: - The module changes into the mode “trusted” for MIDlet execution. “Untrusted Domain” is OFF.

  • Page 104: Change To Secured Mode Concept

    Java User’s Guide 12.2 Execution Control 12.2.1 Change to Secured Mode Concept Create and insert a customer root certificate: A condition for the change to the secured mode is the existence of a customer root certificate inside of the module. Figure 62: Insert Customer Root Certificate After this action the module is in the following conditions: - The module changes into the mode “trusted”...

  • Page 105: Concept For The Signing The Java Midlet

    Java User’s Guide 12.2 Execution Control 12.2.2 Concept for the Signing the Java MIDlet Figure 63: Prepare MIDlet for Secured Mode wm_java_usersguide_v12 Page 105 of 123 2008-02-25 Confidential / Released...

  • Page 106: Application And Data Protection

    Java User’s Guide 12.3 Application and Data Protection 12.3 Application and Data Protection In addition to the Java secured mode it is possible to prevent the activation of the Module Exchange Suite. When Module Exchange Suite access is deactivated with AT^SJSEC, it is no longer possible to access to the Flash file system on the module.

  • Page 107: Structure Of The Java Security Commands

    Java User’s Guide 12.4 Structure and Description of the Java Security Commands 12.4.1 Structure of the Java Security Commands wm_java_usersguide_v12 Page 107 of 123 2008-02-25 Confidential / Released...

  • Page 108: Build Java Security Command

    Java User’s Guide 12.4 Structure and Description of the Java Security Commands 12.4.2 Build Java Security Command Figure 64: Build Java Security Command wm_java_usersguide_v12 Page 108 of 123 2008-02-25 Confidential / Released...

  • Page 109: Send Java Security Command To The Module

    Java User’s Guide 12.4 Structure and Description of the Java Security Commands 12.4.3 Send Java Security Command to the Module Use a terminal program. Enter: AT^SJSEC Wait for the answer: CONNECT JSEC READY: SEND COMMAND ... Now you can send the binary data of the command (for example: from a file with the binary data of the command).

  • Page 110: Create A Java Security Environment Step By Step

    Java User’s Guide 12.5 Create a Java Security Environment Step by Step 12.5 Create a Java Security Environment Step by Step 12.5.1 Create Key Store The key store contains the key pairs for signing data. For producing the key store with keys the tool “keytool.exe”...

  • Page 111

    Java User’s Guide 12.5 Create a Java Security Environment Step by Step Command: switch on Java Security Mode java -jar jseccmd.jar -cmd TrustedModeOn -imei 012345678901234 -alias keyname -storepass keystorepassword -keypass keypassword -keystore customer.ks > TrustedModeOn.bin Command: switch off Java Security Mode java -jar jseccmd.jar -cmd TrustedModeOff -imei 012345678901234 -alias keyname -storepass keystorepassword -keypass keypassword...

  • Page 112: Sign A Midlet

    Java User’s Guide 12.6 Attention 12.5.4 Sign a MIDlet Use the tool “jadtool.jar” to sign a Java MIDlet. This program is in the folder “wkt\bin”. java -jar jadtool.jar -addjarsig -jarfile helloworld.jar -inputjad helloworld.jad -outputjad helloworld.jad -alias keyname -storepass keystorepassword -keypass keypassword -keystore customer.ks -encoding UTF-8 12.6 Attention...

  • Page 113: Java Tutorial

    Java User’s Guide 13 Java Tutorial Java Tutorial This small tutorial includes explanations on how to use the AT Command API and suggestions for programming MIDlets. The developer should read about MIDlets, Threads and AT com- mands as a complement to this tutorial. 13.1 Using the AT Command API Perhaps the most important API for the developer is the AT command API.

  • Page 114: Sending An At Command To The Device, The Send() Method

    Java User’s Guide 13.1 Using the AT Command API 13.1.1.2 Sending an AT Command to the Device, the send() Method An AT command is sent to the device by using the send() method. The AT command is sent as a string which must include the finalizing line feed "\r" or the corresponding line end charac- ter.

  • Page 115: Data Connections

    Java User’s Guide 13.1 Using the AT Command API 13.1.1.3 Data Connections If a data connection is created with the ATCommand class, for instance with ‘atd’, an input stream is opened to receive the data from the connection. Similarly, an output stream can be opened to send data on the connection.

  • Page 116

    Java User’s Guide 13.1 Using the AT Command API These streams behave slightly differently than regular data streams. The streams are not closed by using the close() method. A stream remains open until the release() method is called. A module can be switched from the data mode to the AT command mode by calling the break- Connection() method.

  • Page 117: Synchronization

    Java User’s Guide 13.1 Using the AT Command API 13.1.1.4 Synchronization For performance reasons no synchronization is done in the ATCommand class. If an instance of this class has to be accessed from different threads ensure that the send() functions, the release() function, the cancelCommand() function and the breakConnection() function are syn- chronized in the user implementation.

  • Page 118: Atcommandlistener Interface

    Java User’s Guide 13.1 Using the AT Command API 13.1.3 ATCommandListener Interface The ATCommandListener interface implements callback functions for: • URCs • Changes of the serial interface signals RING, DCD and DSR • Opening and closing of data connections The user must create an implementation class for ATCommandListener to receive AT events. The ATEvent method of this class must contain the processing code for the different AT-Events (URCs).

  • Page 119: Implementation

    Java User’s Guide 13.1 Using the AT Command API 13.1.3.2 Implementation class ATListenerA implements ATCommandListener { public void ATEvent(String Event) { if (Event.indexOf("+CALA: Reminder 1") >= 0) { /* take desired action after receiving the reminder */ } else if (Event.indexOf("+CALA: Reminder 2") >= 0) { /* take desired action after receiving the reminder */ } else if (Event.indexOf("+CALA: Reminder 3") >= 0) { /* take desired action after receiving the reminder */...

  • Page 120: Registering A Listener With An Atcommand Instance

    Java User’s Guide 13.1 Using the AT Command API 13.1.3.3 Registering a Listener with an ATCommand Instance After creating an instance of the ATCommandListener class, it must be passed as a parameter to the ATCommand.addListener() method. The callback methods of the instance will be called by the runtime system each time the corresponding events (URCs or signal state changes) occur on the corresponding device AT parser.

  • Page 121: Programming The Midlet

    Java User’s Guide 13.2 Programming the MIDlet 13.2 Programming the MIDlet The life cycle and structure of MIDlets are described in Java ME , all of Java ME ’s features, including threads, are available. Small applications, such as those without any timer functions or those used only for tests and simple examples, can be written without using threads.

  • Page 122

    Java User’s Guide 13.2 Programming the MIDlet /* Print loop counter and wait 1 second, * do something useful here instead */ System.out.println("Thread(" + loops + "): Loop " + i); try { Thread.sleep(1000); } catch(InterruptedException e) { System.out.println(e); System.out.println("Thread(" + loops + "): Finished naturally"); * ThreadDemo - constructor public ThreadDemo() { System.out.println("ThreadDemo: Constructor, creating threads");...

  • Page 123: Differences To The Tc45

    Java User’s Guide 14 Differences to the TC45 Differences to the TC45 For those who are familiar with the Siemens WM IMP1.0 product (TC45) this is an overview of the main differences between this and the IMP-NG product line (e.g. TC65). •...

This manual also for:

Ac65, Ac75, Xt75, Tc65

Comments to this Manuals

Symbols: 0
Latest comments: