background image

Java User’s Guide

5.12 Performance

49

s

wm_java_usersguide_v12

Page 47 of 123

2008-02-25

Confidential / Released

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. For the measurements, the Java application receives data from the server over GPRS
and sends them over RS232 to an external device.

Figure 18:  

Scenario for testing data rates on ASC1 with GPRS data download

Summary of Contents for AC65

Page 1: ...s Java User s Guide Siemens Cellular Engines Version 12 DocId wm_java_usersguide_v12 Products TC65 AC65 AC75 XT65 XT75 User s Guide ...

Page 2: ...INESS PROFITS BUSINESS INTERRUP 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 UNDER THE GERMAN PRODUCT LIABILITY ACT IN CASE OF INTENT GROSS NEGLI...

Page 3: ... 3 3 1 9 Integrated Documentation Suite IDS 21 3 4 Set up Java Development Environment with Eclipse IDE Quick Start up 22 3 5 Siemens Mobility Toolkit Installation 24 3 5 1 Installing the Standard Development Toolkit 24 3 5 2 Installing the SMTK Environment 24 3 5 3 Installing NetBeans IDE 5 0 NetBeans IDE 5 5 1 26 3 5 4 Installing Eclipse 3 0 Eclipse 3 1 or Eclipse 3 2 26 3 5 5 Installing Borland...

Page 4: ...er Saving 37 5 4 Charging 38 5 5 Airplane Mode 38 5 6 Alarm 38 5 7 Shutdown 39 5 7 1 Automatic Shutdown 39 5 7 2 Manual Shutdown 39 5 7 3 Restart after Switch Off 39 5 7 4 Watchdog 39 5 8 Special AT Command Set for Java Applications 40 5 8 1 Switching from Data Mode to Command Mode 40 5 8 2 Mode Indication after MIDlet Startup 40 5 8 3 Long Responses 40 5 8 4 Configuration of Serial Interface 40 5...

Page 5: ... 2 OTAP Overview 55 8 3 OTAP Parameters 56 8 4 Short Message Format 57 8 5 Java File Format 58 8 6 Procedures 59 8 6 1 Install Update 59 8 6 2 Delete 60 8 7 Time Out Values and Result Codes 61 8 8 Tips and Tricks for OTAP 61 8 9 OTAP Tracer 62 8 10 Security 62 8 11 How To 62 9 Compile and Run a Program without a Java IDE 64 9 1 Build Results 64 9 2 Compile 65 9 3 Run on the Module with Manual Star...

Page 6: ...d JBuilder X 91 11 3 3 1 Examples 92 11 3 3 2 Starting Debug Session without Downloading Java Files 93 11 3 4 Borland JBuilder 2005 and JBuilder 2006 Enterprise Developer 94 11 3 4 1 Examples 95 11 4 Breakpoints 95 11 5 Switching Java System out to IDE Debug Window 96 11 6 Important Information for Java Debugging on Windows Vista 97 12 Java Security 98 12 1 Secure Data Transfer 98 12 1 1 Create a ...

Page 7: ...g an AT Command to the Device the send Method 114 13 1 1 3 Data Connections 115 13 1 1 4 Synchronization 117 13 1 2 ATCommandResponseListener Interface 117 13 1 2 1 Non Blocking ATCommand send Method 117 13 1 3 ATCommandListener Interface 118 13 1 3 1 ATEvents 118 13 1 3 2 Implementation 119 13 1 3 3 Registering a Listener with an ATCommand Instance 120 13 2 Programming the MIDlet 121 13 2 1 Threa...

Page 8: ...ata rate with two timeslots CS5 46 Table 4 EDGE upload data rate with two timeslots CS9 46 Table 5 GPRS Download data rate with different number of timeslots CS2 48 Table 6 GPRS Download data rate with different number of timeslots CS4 48 Table 7 EDGE Download data rate with different number of timeslots CS5 48 Table 8 EDGE Download data rate with different number of timeslots CS9 48 Table 9 A typ...

Page 9: ...optional 60 Figure 22 Create new Eclipse project Create a J2ME MIDP Midlet Suite 67 Figure 23 Create new Eclipse project New J2ME Project 67 Figure 24 Create new Eclipse project Midlet Suite Properties 68 Figure 25 Create new Eclipse project work area with new created project 68 Figure 26 Create new Eclipse project Create a J2ME Midlet 69 Figure 27 Create new Eclipse project Create a New J2ME Midl...

Page 10: ... 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 97 Figure 59 Mode 1 Customer Root Certificate does not exis...

Page 11: ...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 For use in file directory or path names the string productname represents the actual name of a product for exam ple TC65 Screenshots are provided as examples and unless otherwise stated apply...

Page 12: ...he module allow you to easily integrate your application This document explains how to work with the ME the installation CD and the tools provided on the installation CD Figure 1 Overview 2 1 Related Documents List of documents referenced throughout this manual 1 AT Command Set of your Siemens Wireless product 2 Hardware Interface Description of your Siemens Wireless product 3 Java doc wtk doc htm...

Page 13: ...TP Hypertext Transfer Protocol I O Input Output IDE Integrated Development Environment IDS Integrated Documentation Suite IP Internet Protocol Java ME Java Mobile Edition aka J2ME Java SE Java Standard Edition JAD Java Application Description JAR Java Archive JDK Java Development Kit JVM Java Virtual Machine LED Light Emitting Diode ME Mobile Equipment MES Module Exchange Suite MIDP Mobile Informa...

Page 14: ...s Guide 2 2 Terms and Abbreviations 14 s wm_java_usersguide_v12 Page 14 of 123 2008 02 25 Confidential Released URL Universal Resource Locator VBS Visual Basic Script WTK Wireless Toolkit Abbreviation Description ...

Page 15: ...ed for TC65 If a Java IDE such as NetBeans IDE 5 0 NetBeans IDE 5 5 11 Eclipse 3 0 1 Eclipse 3 0 2 Eclipse 3 1 0 Eclipse 3 1 1 Eclipse 3 1 2 Eclipse 3 2 x1 JBuilder X 2005 or 2006 Enterprise Developer is installed it can be integrated into the SMTK environment during the installation of the SMTK To install one of the IDEs follow the installation instructions in Section 3 5 3 and Section 3 5 4 resp...

Page 16: ...n 1 5 03 eclipseme feature_1 5 0_site zip Eclipse ME Plugin 1 5 0 EclipseME plugin WM only required for Eclipse 3 0 1 and Eclipse 3 0 2 GPS Evaluation Software 4 ucentersetup exe GPS Evaluation SW Integrated Documentation Suite IDS IDS zip Documents DSB75_HW_Description pdf productname _AT_Command_Set pdf productname _HW_Description pdf productname T_HW_Description pdf only if terminal version is ...

Page 17: ...3 1 2 eclipse SDK 3 1 2 win32 zip Eclipse 3 1 2 Eclipse 3 2 2 eclipse SDK 3 2 2 win32 zip Eclipse 3 2 2 EclipseME plugin 1 5 5 eclipseme feature_1 5 5_site zip Eclipse ME Plugin 1 5 5 EclipseME plugin 1 6 8 eclipseme feature_1 6 8_site zip Eclipse ME Plugin 1 6 8 Integrated Documentation Suite IDS IDS zip Documents productname _Datasheet pdf DSB75_HW_Description pdf productname _AT_Command_Set pdf...

Page 18: ...Properties and selecting the Version tab e g MESCopy exe Version 1 0 0 12 etc MES server files under ModuleExchange directory e g C Program Files Module Exchange The version of the dll files can be read out by using the Windows Explorer context menu Properties and selecting the Version tab e g MESShellExt dll Version 2 0 0 19 MESServer exe Version 2 0 0 38 MESSearchApp exe Version 2 0 0 5 The MES ...

Page 19: ...elopment Kit 1 55 Registry key JavaHome e g C j2sdk1 4 2_09 JavaHome e g C Program Files Java jdk1 5 0_07 5 Registry path HKEY_LOCAL_MACHINE SOFTWARE JavaSoft Java Runtime Environment 1 4 HKEY_LOCAL_MACHINE SOFTWARE JavaSoft Java Runtime Environment 1 55 Registry key JavaHome e g C Program Files Java j2re1 4 2_09 JavaHome e g C Program Files Java j2re1 5 0_07 5 3 3 1 4 NetBeans IDE 5 0 This is a J...

Page 20: ...he Eclipse Version 1 5 0 Used JDK from IDE e g selecting Eclipse menu Help About Eclipse SDK Configuration Details and look for java version and java vm version 3 3 1 7 Eclipse 3 2 2 IDE and Eclipse ME Plugin 1 5 5 or 1 6 8 This is a Java IDE provided by the Eclipse Foundation to support Java application develop ment The integration of SMTK into Eclipse 3 2 2 with ME Plugin 1 6 8 is only supported...

Page 21: ...r tool together with XT75 module with GPS support Step 1 Install u center GPS_Evaluation_SW ucentersetup exe on XT75 CD Step 2 Switch to transparent GPS mode by using the AT command AT SGPSS 1 1 Step 3 Configure the connected COM port ASC0 of the XT75 module by using the u center menu Receiver Port and Receiver Baudrate Now the XT75 module and the u center are ready for operation 3 3 1 9 Integrate...

Page 22: ...lled on your machine Step 2 Install Eclipse 3 1 2 Unzip from CD Eclipse eclipse SDK 3 1 2 win32 zip to C Program Files Eclipse Installation of Eclipse 3 2 2 to be employed with TC65 is completed in the same way Step 3 Installation Eclipse ME plugin 1 2 3 Installation of Eclipse ME plugin 1 6 8 to be employed with TC65 is completed in the same way Start Eclipse IDE Select the default workspace sugg...

Page 23: ...tallation of the product s SMTK Start setup exe from CD root path Choose the destination folder of Eclipse C Program Files Eclipse in the dialog box Select Eclipse Folder Select SMTK e g C Program Files Siemens SMTK in dialog box Destination Folder Use the the dialog box Select COM Port to specify the connection type for on device debugging and MES transfer downloading the MIDlet to the module a S...

Page 24: ...the SMTK Environment Before you start the installation please make sure all applications especially the IDEs are closed 1 Insert the CD start setup exe When the dialog box appears press the Next button 2 You will be asked to read the license agreement If you accept the agreement press Yes to continue with the installation 3 A file including special information about the installation and use of the...

Page 25: ...ation If you have chosen the Standard 119200 bps Modem select the COM port number click Next In the resulting dialog box select the baud rate and click Next again If you have chosen the USB modem the available USB modems will be listed Choose the Siemens AG WM USB Modem and click Next Note You can reconfigure the COM port for the Dial Up Network connection any time after the installation by starti...

Page 26: ... 0 CD directory EclipseMEplugin_150 are provided on the SMTK CD The installation of Eclipse is shortly described in Section 3 4 8 Eclipse can be freely downloaded from http www eclipse org In order to use Eclipse with the ME the EclipseME plug in is also needed It can be downloaded from http eclipseme org Using Eclipse 3 0 1 or Eclipse 3 0 2 A customized version of this plug in CD directory Eclips...

Page 27: ...lly if no SMTK IMP NG product is installed in parallel The user will be asked for uninstall of standard modem and Dial Up Network DUN in the case that another SMTK IMP NG product is installed The Module Exchange Suite MES is not uninstalled automatically with the SMTK If you would like to uninstall the Module Exchange Suite MES as well please run the MES uninstall facility To run the uninstall pro...

Page 28: ...imited device configuration hot spot implementation IMP NG the information module profile 2nd generation this is for the most part identical to MIDP 2 0 but without the lcdui package Additional Java virtual machine interfaces AT Command API File I O API The data flow through these interfaces is shown in Figure 7 and Figure 29 Memory space for Java programs Flash File System around 1700k 1200k in X...

Page 29: ...rmation about usage and startup behavior 4 2 3 DAC ADC There are two analogue input lines and one analogue output line They are accessed by AT commands See 1 and 2 for details The TC65 Terminal does not feature DAC interface 4 2 4 ASC1 ASC1 is the second serial interface on the module This is a 4 pin interface RX TX RTS CTS It can be used as a second AT interface when a Java application is not run...

Page 30: ... details see 3 location listener a periodic call back with current location information proximity listener a call back when a specified location is close landmark store a storage for landmarks way points The landmark store is persistent The stores are saved to FFS under a lmstores store_X xml where X is the number of the store 0 is the default store There can be 8 stores plus 1 default store each ...

Page 31: ... 3 4 2 8 1 IP Networking IMP NG provides access to TCP IP similarly to MIDP 2 0 Because the used network connection CSD or GPRS is fully transparent to the Java interface the CSD and GPRS parameters must be defined separately either by the AT command AT SJNET 1 or by parameters given to the connector open method see 3 4 2 8 2 Media The playTone method and the tone sequence player are supported For...

Page 32: ...ets the JAR file and calls the interfaces to the module environment The module environment consists of the Flash File System available memory for Java applications TCP IP module internal TCP IP stack GPIO general purpose I O ASC0 Asynchronous serial interface 0 ASC1 Asynchronous serial interface 1 I2C 12Cbus interface SPI Serial Peripheral Interface DAC digital analog converter ADC analog digital ...

Page 33: ...to one of the AT parsers two instances of access to a serial interface ASC0 and ASC1 through the CommCon nection API Access to the control lines of these interfaces through CommConnection ControlLines TC65 only System out over any serial interface or into the file system 4 4 1 Module States The module can exist in the following six states in relation to a Java application the serial inter faces GP...

Page 34: ...4 1 3 State 4 Default Java Application Active The Java application is active and ASC0 and ASC1 are used as System out and or CommCon nection Java instances of AT commands are connected to the available AT parsers The Java application is activated with AT SJRA refer to 1 or autostart Figure 10 Module State 4 4 4 1 4 State 5 Java Application Active General Purpose I O and I2C SPI The Java applicatio...

Page 35: ...es 35 s wm_java_usersguide_v12 Page 35 of 123 2008 02 25 Confidential Released 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 ...

Page 36: ...rofile In the simplest case use connection profile 0 for the Internet Services and set the parameters to the same values as the Java networking parameters This way it makes no difference whether the connection is activated by the Internet Services or Java There are some aspects which have to be kept in mind for all IP Services Java and AT com mand When an open TCP connection is cut e g the other s...

Page 37: ...mitations In NON CYCLIC SLEEP mode cfun 0 the serial interface cannot be accessed Toggling RTS does end NON CYCLIC SLEEP mode In CYCLIC SLEEP mode CFUN 7 or 9 the serial interface can be used with hardware flow control CTS RTS In all SLEEP modes the GPIO polling frequency is reduced so that only signal changes which are less than 0 2Hz can be detected properly Furthermore the signal must be con st...

Page 38: ...ed or left using the appropriate AT SCFG command This AT command can also be used to configure the airplane mode as the standard startup mode see 2 The JVM is started when autostart is enabled A Java appli cation must be able to handle this mode The airplane mode is indicated by URC SYSSTART AIRPLANE MODE Since the radio is off all classes related to networking connections e g SocketConnection UDP...

Page 39: ...lt conditions occur For further detail refer to the commands AT SCTM and AT SBC described in the AT Com mand Set 1 In addition a description of the shutdown procedures can be found in 2 5 7 2 Manual Shutdown The module can be switched off manually with the AT command AT SMSO or when using the TC65 Terminal by pressing the ignition key for a period of time see 2 In these cases the midlets destroyAp...

Page 40: ... 3 Long Responses The AT Command API can handle responses of AT commands up to a length of 1024 bytes Some AT commands have responses longer than 1024 bytes for these responses the Java application will receive an Exception Existing workarounds Instead of listing the whole phone book read the entries one by one Instead of listing the entire short message memory again list message after message Sim...

Page 41: ... and the ATCommand class 5 9 System Out Any output printed to the System out stream by a Java application can be redirected to one of the serial interfaces a file a NULL device i e the output will be discarded or a UDP socket for using the debugger from an IDE The configuration can be done at any time using the AT command AT SCFG see 1 for details and is non volatile 5 9 1 Serial interfaces System...

Page 42: ...n UDP socket any changes of the System out configuration are ignored while the Virtual Machine is running The UDP Socket settings will not be stored in the module 5 10 GPIO The GPIO Java API classes InPort OutPort InPortListener StartStopPulseCounter Limit PulseCounter and LimitPulseCounterListener is a replacement for the GPIO AT commands AT SPIO AT SCPIN Using these classes frees up AT command r...

Page 43: ...ava instruction was used for calculation of the typical jPS value 2 x number of calculation statements 1 frequencyB 1 frequencyA Measurement and calculation were done using duration of each loop 600 s number of calculation statements 50 result CONSTANT_VALUE variable_value Instructions executed twice per pin cycle frequencyA as measured with a universal counter frequencyB as measured with a univer...

Page 44: ... by the virtual machine Consequently pin I O is not suitable for generating or detecting frequencies 5 12 3 Data Rates on RS 232 API For details about the software platform and interfaces refer to Chapter 4 Software Platform 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...

Page 45: ...aximum 184kbit s net data rate Figure 15 Scenario for testing data rates on ASC1 5 12 3 2 Voice Call in Parallel Same scenario as in Section 5 12 3 1 but with a voice call added The application reflects incoming data directly to output and additionally handles an incoming voice call The data rates are also up to 180kbit s Test conditions same as in Section 5 12 3 1 Figure 16 Scenario for testing d...

Page 46: ...heor Value 9 12 75 15 24 63 20 36 55 16 48 33 Table 2 GPRS upload data rate with different number of timeslots CS4 Upload data rate with x timeslots Coding scheme 4 kbit s 1 time slot theor Value1 1 net transmission rates for LLC layer from theor Value 2 time slots theor Value1 from theor value 3 time slots theor Value1 from theor value 4 time slots theor Value1 from theor value 13 20 65 22 40 55 ...

Page 47: ...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 For the measurements the Java application receives data from the server over GPRS and sends them over RS232 to an external device Figure 18 Scenario for testing data rates on ASC1 with GPRS data download ...

Page 48: ...with different number of timeslots CS4 Download data rate with x timeslots Coding scheme 4 kbit s 1 time slot theor Value 1 1 net transmission rates for LLC layer from theor Value 2 time slots theor Value1 from theor value 3 time slots theor Value1 from theor value 4 time slots theor Value1 from theor value 17 20 85 31 40 78 35 60 58 38 80 48 Table 7 EDGE Download data rate with different number o...

Page 49: ...leased 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: ...let has released all of its resources and terminated This state is only entered once State changes are controlled by the MIDlet interface which supports the following methods pauseApp the MIDlet should release any temporary resources and become passive startApp the MIDlet starts its execution needed resources can be acquired here or in the MIDlet constructor Note Take care that the startApp method...

Page 51: ...MIDlet The default no argument con structor for the MIDlet is called it is in the Paused state The application management software has decided that it is an appropriate time for the MIDlet to run so it calls the MIDlet startApp method for it to enter the Active state The MIDlet acquires any resources it needs and begins to perform its service The application management software no longer needs the...

Page 52: ...ava 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 System out println nHello World n destroyApp pauseApp public void pauseApp System out println HelloWorld pauseApp destroyApp public void destroyApp boolean cond...

Page 53: ...0 flash objects files and subdirectories per directory in the flash file system of the module is recommended 7 1 1 Windows Based The directory is called Module and can be found at the top level of workspace MyComputer To transfer a file to the module simply copy the file from the source directory to the target direc tory in the Module Module Disk A 7 1 2 Command Line Based A suite of command line ...

Page 54: ...ction rules for Java applications prevent opening reading copying moving or renaming of JAR files It is not recommended that the name of a Java application for example name jar be used for a directory since the copy protection will refuse access to open copy or rename such directories 7 3 2 OTAP A password should be used to update with OTA SMS Authentication Parameters should be set to fixed value...

Page 55: ...t from the device fitted with the Java enabled module an http server which is accessible over a TCP IP connection either over GPRS or CSD and an SMS sender which can send Class1 PID 7d short messages This is the PID reserved for a module s data download Figure 19 OTAP Overview The Java Application Server http Server contains the jar and the jad file to be loaded on the device Access to these files...

Page 56: ...cted network bearer this is either an access point name for GPRS or a telephone number for CSD Net User a username used for authentication with the network Net Password a password used for authentication with the network DNS a Domain Name Server s IP address used to query hostnames NotifyURL the URL to which results are posted This parameter is only used when the MIDlet Install Notify attribute or...

Page 57: ...veral SMs There is one single keyword to start the OTAP procedure For parameters that are repeated in several SMs only the last value sent is valid For example an SM could look like this Install operation First SM OTAP_IMPNG PWD secret JADURL http www greatcompany com coolapps mega jad APPDIR a work appdir HTTPUSER user HTTPPWD anothersecret Second SM OTAP_IMPNG PWD secret BEARER gprs APNORNUM acc...

Page 58: ...ly with the IMP NG and ME specifications There are cer tain components of the JAD file that the developer must pay attention to when using OTAP MIDlet Jar URL make sure that this parameter points to a location on the network where your latest JAR files will be located e g http 192 168 1 3 datafiles mytest jar not in the filesystem like file a java mytest mytest jar Otherwise this JAD file is usele...

Page 59: ...tall 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 If there is any error during an update operation the old application is kept untouched with one exception If there is not enough space in the file system to keep Manifest Version 1 0 MIDlet Name MyTest MIDlet Version 1 0 1...

Page 60: ...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 When an SM with keyword START delete is received and there is a valid parameter set for this operation the module reboots either when the operation completed an error occurred or the safety timer expired If there is any error th...

Page 61: ...he User Agent field e g User Agent productname 000012345678903 Profile IMP NG Configuration CLDC 1 1 This eases device identification at the HTTP server 8 8 Tips and Tricks for OTAP For security reasons it is recommended that an SMS password be used Otherwise the ìdeleteî operation can remove entire directories without any authentication For extra security set up a private CSD PPP Server and set i...

Page 62: ...he answer is yes then read through the following steps if the answer is no then consider simply setting the OTAP SMS pass word to protect your system Then you are finished with OTAP 2 Take a look at the parameters Section 8 3 which control OTAP You need to decide which of them you want to allow to be changed over the air by SMS and which you do not This is mainly a question of security and what ca...

Page 63: ...the wrong password or your parameter set is incomplete for the requested operation If the device terminated the running Java application but did not access your http server and rebooted after the safety timeout there were most likely some problems when open ing the network connection Check your network parameters If the device downloaded the jad and possibly even the jar file but then rebooted wit...

Page 64: ...e as described in Section 7 1 or with OTA provisioning OTA provisioning is described in Chapter 7 In addition to class and resource files a JAR file contains a manifest file which describes the contents of the JAR The manifest has the name manifest mf and is automatically stored in the JAR file itself An IMP manifest file for includes at least A JAD file must be written by the developer and must i...

Page 65: ...t variables A mod ification is usually not necessary They may be modified as requested e g when switching to a different JDK via the advanced system properties 9 3 Run on the Module with Manual Start Compile the application at the prompt as discussed in Section 9 2 or in an IDE Transfer the jar and jad file from the development platform to the desired directory on the module using the Module Excha...

Page 66: ...e three methods for switching off the autostart feature the AT SCFG command or the graphical autoexec_off exe tool included in the Installation CD software under wtk bin or the command line cmd_autoexec_off exe tool included in the Installation CD software under wtk bin To disable the automatic start of a user application in a module these steps must be carried out Using the graphical autoexec_off...

Page 67: ... 2 3 The following description assumes that Eclipse 3 1 2 is installed from SMTK CD as described in Section 3 3 1 6 10 1 1 Setup a New Project Step 1 Create new Java Project Select Eclipse menu File New Other Select J2ME Midlet Suite Figure 22 Create new Eclipse project Create a J2ME MIDP Midlet Suite Type in the used name e g Project01 and path for the new project Figure 23 Create new Eclipse pro...

Page 68: ...va_usersguide_v12 Page 68 of 123 2008 02 25 Confidential Released 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 ...

Page 69: ...23 2008 02 25 Confidential Released 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 ...

Page 70: ...ct Edit some Java commands This application prints the given line via ASC1 default setting Please keep in mind to add notifyDestroyed in destroyApp method Please refer to Chapter 6 MIDlets for more details about Midlet life cycles Step 3 Configure Jad file Double click on Project01 jad to open the editor and add deployed path in Midlet Jar URL edit line Figure 29 Create new Eclipse project Edit de...

Page 71: ... the Java application by using at command AT SJRA a Project01 jar e g using ASC1 The Java System out is printed via ASC1 default setting and is displayed on terminal programs e g Print this line Automatic download and start of Java application using IDE Open the context menu of printme java and select Emulated J2ME Midlet from item Run As The SMTK emulator downloads Jar and Jad file into the Flash...

Page 72: ...erial interface This can be a USB or an RS232 line The application can then be edited built debugged or run within an IDE on the PC When running or debugging the MIDlet under IDE control it is executed on the module on device execution not on the PC This can be either debugging mode where the midlet execution can still be controlled from the IDE on device debugging or normal mode where the midlet ...

Page 73: ...nection between the PC and the module the emulator needs a special Dial Up Network DUN ISP name IP connection for remote debugging Modem either Standard 19200 bps Modem or productname 14400 bps Modem or USB modem Phone number 88 Disable the Redial if line dropped option Enable Connect automatically This Dial Up Network DUN connection is installed automatically together with a standard modem or sel...

Page 74: ...ess range 10 x x x is not supported for the configuration of debugging During installation of SMTK some new programs are installed for handling the debugging ses sion in conjunction with the IDE The installation routine of the SMTK doesn t change any con figuration of an existing firewall on your PC In the case that a firewall is installed on your PC and the local configured and used IP connec tio...

Page 75: ...ed is used as a default setting in the Eclipse IDE and can be changed by the user within the Eclipse menu While using on device debugging the ME is restarted after the end of each debugging ses sion This is independent of the used IDE Eclipse 3 0 1 Eclipse 3 0 2 Eclipse 3 1 0 Eclipse 3 1 1 Eclipse 3 1 2 Eclipse 3 2 x10 NetBeans IDE 5 0 NetBeans 5 5 x10 JBuilder X JBuilder 2005 JBuilder 2006 Enterp...

Page 76: ...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 See Figure 32 Figure 32 NetBeans IDE 5 0 Switching to IMP NG emulator ...

Page 77: ...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 The New File wizard opens Select category IMP NG and File Type IMP NG MIDlet and press the Next button for working with this skeleton Figure 33 NetBeans IDE 5 0 Selecting an IMP NG MIDlet template e g project Test ...

Page 78: ... e g Hello World Example Press the Next button Figure 34 NetBeans IDE 5 0 selecting sample project Hello World Sample Figure 35 NetBeans IDE 5 0 confirmation of sample project Hello World Sample Press the Finish button to end the selection of the sample project Note Keep in mind that if you are selecting the HelloWorld Sample you have to choose the used emulator after loading the HelloWorld Sample...

Page 79: ...mulator has to be started with an additional parameter noload and downloading of the Java files is suppressed If you like to suppress downloading of jar and jad file please use the project context menu Properties select category Running and type in noload as extra parameter for the emulator as shown in the following figure Figure 36 NetBeans IDE 5 0 add emulator option noload e g project HelloSamp...

Page 80: ...ing 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 To display the Java System out s after starting the debugging session select the build xml debug tab as shown in the below figure Figure 37 NetBeans IDE 5 0 Displaying Java System out in N...

Page 81: ...ad of selecting eclipseme feature_1 2 3_site zip choose EclipseMEpluging_WM plugin zip 12 from SMTK CD after clicking the New Archived Site button 11 3 2 2 Eclipse 3 1 If Eclipse is not installed please follow the steps as described in Section 3 4 Please use and install EclipseME plugin 1 2 1 1 2 3 or 1 5 x for Eclipse 3 1 0 3 1 1 or 3 1 2 11 3 2 3 Eclipse 3 2 If Eclipse is not installed please fo...

Page 82: ...uration is displayed after SMTK integration into Eclipse by using the Eclipse menu Windows Preferences J2ME Platform Components Figure 38 Eclipse Display of different integrated emulators To use the debugger it is necessary to increase the debug server delay timeout of Eclipse IDE Please set the timeout under Windows Preferences J2ME Debug Server Delay to 25000 If you develop an extremely large ap...

Page 83: ...ing 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 XT65 XT75 or AC65 AC75 SMTK CD Please note that selecting the TC65 resp XT65 XT75 or AC65 AC75 emulator by using the Eclipse menu Window Preferences J2ME Device Management Import and...

Page 84: ...tion 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 Please set the timeout under Windows Preferences J2ME Debug Server Delay to 25000 If you develop an extremely large application you may ha...

Page 85: ... IMP NG XT75 Wireless Toolkit You can select a device also by using the Manage Devices button see figure below Figure 41 Eclipse with ME Plugin 1 5 0 J2ME platform 11 3 2 6 Using Eclipse with ME Plugin 1 6 x Automatic integration into Eclipse ME Plugin 1 6 x is supported by using the TC65 CD All con figurations settings and using the Eclipse IDE are done in a very similar way as for Eclipse ME Plu...

Page 86: ...ile Import Existing Project into Workspace Choose the root directory of the Eclipse project e g Hello World example of the SMTK CD See figure below Figure 42 Eclipse Project import The following figure shows the Hello World example in the IDE Figure 43 Eclipse Example The html help files of the SMTK can be accessed directly by pressing Shift F2 while the cursor points to a Java expression in a Jav...

Page 87: ...ging session Please ensure that you have selected the right project and executable midlet Note Before starting Java debugging session with the HelloWorld Sample it is recommended to check the setting of used emulator e g TC65_R3 emulator in project properties see Section 11 3 2 5 2 to clean the project with configuration automatically build using Eclipse menu Project Clean and to compile it comple...

Page 88: ...nents as shown in Figure 36 Please keep in mind that all manually integrated SMTKs have to be removed manually as well in case of removing SMTK Note for using Eclipse 3 2 2 ME 1 6 8 Start debugging using TC65 Rel 3 emulator please select in Midlet the HelloWorld Midlet sample from the list of Midlets The project name will be selected automatically Remarks using Eclipse under Windows Vista only sup...

Page 89: ...e as described in the figure Figure 46 Eclipse Configuration Please keep in mind that you have to remove this emulator option before starting debugging session with download of Java files The Java files are not updated in the Flash files system of the module while option noload is set Note for Eclipse 3 2 2 ME 1 6 8 The option noload does not take previously set breakpoints into account In other w...

Page 90: ...t no breakpoint is indicated in the Java source line Java source windows In this case please select the Java Thread in the Debug window and select System Thread where the hit breakpoint is shown The corresponding source line is highlighted inside the Java source windows e g HelloWorld java as well for the hit breakpoint See the following figure Figure 47 Eclipse 3 2 x ME1 5 x and 1 6 x select Syst...

Page 91: ...e SMTK installation program in maintenance mode The SMTK will find the installed JBuilder X IDE Select JBuilder X to integrate the SMTK into JBuilder X After integration of SMTK into JBuilder X you can examine the integration by opening the menu Tools Configure JDKs see Figure below Figure 48 JBuilder X JDK settings The libraries included with the SMTK can be examined by opening the menu Tools Con...

Page 92: ...e JBuild erSamples directory of the SMTK installation directory This directory is accessed by opening a project using the menu File Open Project see Figure below Figure 50 JBuilder X Sample Projects Open the Project e g HelloWorld jpx rebuild the sources and start the debugger using the micro edition context menu HelloWorld jad Micro Debug using HelloWorld Figure 51 JBuilder X Starting the debuggi...

Page 93: ...llowing emulator running configuration line as described in the figures above Select the project properties e g HelloWorld jpx and edit the emulator configuration Figure 52 JBuilder X Edit project properties for starting the emulator Set the additional emulator parameter noload and press OK Figure 53 JBuilder Runtime Configuration Keep in mind that you have to remove this emulator option before st...

Page 94: ...K will find the installed JBuilder 2005 or JBuilder 2006 Enterprise Developer IDE Select JBuilder 2005 or JBuilder 2006 Enterprise Developer to integrate the SMTK into JBuilder 2005 or JBuilder 2006 Enter prise Developer After the integration of the SMTK into JBuilder 2005 or JBuilder 2006 Enterprise Developer you can examine the integration by opening the menu Tools Configure JDKs see Figure belo...

Page 95: ...e SMTK installation directory This directory is accessed by opening a project using the menu File Open Project see Figure below Figure 56 JBuilder 2006 Enterprise Developer Sample Projects Starting the debugging session is done in the same way as for JBuilder X see chapter for JBuilder X above 11 4 Breakpoints Breakpoints can be set as usual within the IDE The debugger cannot step through methods ...

Page 96: ...t to serial port is used as default setting Figure 57 Emulator configuration file switching Java System out to serial port The following line of the WM_Debug_config ini file is used for switching the Java System out direction UDPport 12345 To switch the Java System out direction to the UDP socket and display it on a IDE window please remove The configuration line looks as follows UDPport 12345 To ...

Page 97: ...g Temporarily Right click the IDE icon on your desktop and select Run as administrator or Permanently Open the Windows Explorer and change the option for the IDE executable For example right click the Eclipse exe select Properties and tab Compatibility then select Run this program as an administrator in section Privilege Level see figure below Figure 58 Using Windows Vista Set Eclipse exe perament...

Page 98: ...et default is trusted after inserting the certificate see Section 12 2 1 Enable disable untrusted domain in trusted mode default is disabled Switch MES default is ON see Section 12 3 Switch https certificate verification default is OFF see Section 12 1 Restrictions The module does not supply users independent date time base Therefore no examination of the validity of the expiration date time of th...

Page 99: ... Root Certificate is inside of the module Command Switch on Certificate Verification for HTTPS Connections was sent The server certificate is examined when setting up a connection Two configurations are valid The server certificate is identical to the certificate in the module both certificates are self signed root certificates or the server certificate forms a chain with the certificate of the mo...

Page 100: ...te verification is activated for a data connection HTTPS or SecureConnection The steps described below use the cygwin openssl environment for installation see http www cygwin com The openssl documentation can be found here http www openssl org docs apps openssl html A CA Root certificate is generated This certificate can be placed on the HTTPS Server Another possibility is to use the private key o...

Page 101: ...eystore Execute command The field name of the certificate is the domain name or the IP address of the server 3 Create certificate request for server certificate Execute command 4 Sign certificate request by CA Execute command Convert file format from PEM to DER perl CA pl newca openssl x509 in demoCA cacert pem inform PEM out demoCA cacert der outform DER openssl pkcs8 in demoCA private cakey pem ...

Page 102: ...rification for HTTPS Connections to the module See Section 12 5 3 Result You have a keystore for the configuration of the Java Security of the module You have a signed server certificate files server pem or server der You have a private key file for your server configuration files server_privkey pem or server_privkey der The module contains the CA Root Certificat HTTPS certificate verification is ...

Page 103: ... customer if they are marked with a signature The device examines each command with the public key of the customer root certificate The secured mode supports a simple protection domain concept providing a domain for unsigned MIDlets If this domain domain for untrusted MIDlets is active then an unsigned MIDlet is assigned to this domain and has only limited access to the Java API The untrusted doma...

Page 104: ...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 for MIDlet execution Untrusted Domain is OFF HTTPS certificate verification is OFF MES is ON ...

Page 105: ...a User s Guide 12 2 Execution Control 112 s wm_java_usersguide_v12 Page 105 of 123 2008 02 25 Confidential Released 12 2 2 Concept for the Signing the Java MIDlet Figure 63 Prepare MIDlet for Secured Mode ...

Page 106: ...the deactiva tion of the access to the Flash file system is the existence of a customer root certificate inside of the module see Section 12 2 1 The default state of MES is ON 12 4 Structure and Description of the Java Security Commands Special commands are used in the Java security environment These commands are trans ferred to the module with the help of the special AT command AT SJSEC This comm...

Page 107: ...ava User s Guide 12 4 Structure and Description of the Java Security Commands 112 s wm_java_usersguide_v12 Page 107 of 123 2008 02 25 Confidential Released 12 4 1 Structure of the Java Security Commands ...

Page 108: ...ide 12 4 Structure and Description of the Java Security Commands 112 s wm_java_usersguide_v12 Page 108 of 123 2008 02 25 Confidential Released 12 4 2 Build Java Security Command Figure 64 Build Java Security Command ...

Page 109: ... state OBEX state untrusted domain certificate content state Java security mode 0 Unsecured mode i e security mode not active default 1 Secured mode i e security mode active HTTPS state 0 The HTTPS connection or Secure Connection is possible if the server certificate or certificate chain is valid default 1 The HTTPS Connection or Secure Connection is possible only if the server certificate is sign...

Page 110: ... producing the java security commands the tool jseccmd jar can be used This program is in the folder wkt bin Command for inserting the Customer Root Certificate In consequence of the command Java security mode ON untrusted domain OFF HTTPS certificate verification OFF MES state ON Command for removing the Customer Root Certificate In consequence of the command all switches are reset Java security ...

Page 111: ... keypassword keystore customer ks TrustedModeOff bin java jar jseccmd jar cmd UntrustedDomainOn imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks UntrustedDomainOn bin java jar jseccmd jar cmd UntrustedDomainOff imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks UntrustedDomainOff bin java jar ...

Page 112: ...f Java Security is activated and you lose the private key then the module is destroyed You have no chance of deactivating Java Security downloading of a new Midlet or starting any other operation concerning Java Security To prevent problems you are strongly advised to secure the private key java jar jadtool jar addjarsig jarfile helloworld jar inputjad helloworld jad outputjad helloworld jad alias...

Page 113: ... many ATCommand instances as there are parsers on the device If there are no more parsers available the ATCommand constructor will throw ATCommand FailedException All AT parser instances support CSD However from a Java application point of view it may make sense to have one dedicated instance for CSD call handling Therefore and also for historical reasons only one parser with CSD support may be re...

Page 114: ...Occasionally it may be infeasible to wait for an AT command that requires some time to be pro cessed such as AT COPS There is a second non blocking send function which takes a sec ond parameter in addition to the AT command This second parameter is a callback instance ATCommandResponseListener Any response to the AT command is delivered to the callback instance when it becomes available The method...

Page 115: ...ALLED_NO r System out println received response if response indexOf CONNECT 0 try We have a data connection now we do some streaming IOException will be thrown if any of the Stream methods fail OutputStream dataOut ATCmd getDataOutputStream InputStream dataIn ATCmd getDataInputStream out streaming dataOut write new String n rHello world n r getBytes dataOut write new String n rThis data was sent b...

Page 116: ...ult codes returned after data connection release Data Connections are not only used for data transfer over the air but also to access external hardware Here is a list of at commands which open a data connection atd for data calls AT SSPI for access to I2C SPI AT SIS commands for Internet services For data connection signaling see also Section 13 1 3 continue example if rcv 1 Now break the data con...

Page 117: ...nce of the ATCommandResponseListener class the class instance can be passed as the second parameter of the non blocking ATCommand send method After the AT command has been passed to the AT parser the function returns immediately and the response to the AT command is passed to this callback class later when it becomes available Somewhere in the application A running AT command sent with the non blo...

Page 118: ...NNChanged method indicates the start and the end of data connections During a data connection it is possible to transfer data with the I O stream methods see Section 13 1 1 3 Some data services i e FTP transfer the data so quickly that the CONNChanged start and close events are received even parallel to the response of the AT command which originated the data connection The user s application must...

Page 119: ...lic void DCDChanged boolean SignalState public void DSRChanged boolean SignalState class ATListenerB implements ATCommandListener public void ATEvent String Event if Event indexOf SCKS 0 0 System out println SIM Card is not inserted perform other actions else if Event indexOf SCKS 1 0 System out println SIM Card is inserted perform other actions public void RINGChanged boolean SignalState take som...

Page 120: ... on the corresponding device AT parser The ATCommand removeListener method removes a listener object that has been previously added to the internal list table of listener objects After it has been removed from the list it will not be called when URCs occur If it was not previously registered the list remains unchanged The same ATCommandListener may be added to several ATCommand instances and sever...

Page 121: ...or example threads can be launched in startApp and destroyed in destroyApp Note that destroying Java threads can be tricky It is recommended that the developer read the Java doc umentation on threads It may be necessary to poll a variable within the thread to see if it is still alive 13 2 2 Example This example derives a class from Thread and creates two instances of the subclass One thread instan...

Page 122: ...ateChangeException System out println ThreadDemo startApp starting threads thread1 start thread2 start System out println ThreadDemo Waiting 4 seconds before stopping threads try Thread sleep 4000 catch InterruptedException e System out println e destroyApp true System out println ThreadDemo Closing application pauseApp public void pauseApp System out println ThreadDemo pauseApp destroyApp public ...

Page 123: ...be proprietary com siemens icm io is now part of the standard package javax microedition io No interface emulation on the PC When running a MIDlet under the emulator it is com pletely executed in the connected module and therefore uses the modules ìrealî interfaces The emulation of interfaces such as networking file system or serial interface on the PC side no longer exists jad files required A su...

Reviews: