Nokia Standard Document Template
Total Page:16
File Type:pdf, Size:1020Kb
GETTING STARTED WITH JAVA ON THE NOKIA 9200 SERIES COMMUNICATORS Version 1.0 5 March 2002 GETTING STARTED WITH JAVA ON THE NOKIA 9200 SERIES COMMUNICATORS Version 1.0 Table of Contents INTRODUCTION .............................................................................................................................................................................4 1. JAVA CAPABILITIES OF NOKIA 9200 SERIES COMMUNICATORS.................................................................................4 2. GETTING STARTED...............................................................................................................................................................5 2.1. NOKIA 9200 SERIES COMMUNICATORS SDK FOR SYMBIAN OS................................................................................................................5 2.2. PC RUNNING MICROSOFT WINDOWS..........................................................................................................................................................6 2.3. JDK 1.1.8 ....................................................................................................................................................................................................6 2.4. GSM PHONE WITH INFRARED MODEM........................................................................................................................................................6 3. USING AN IDE ......................................................................................................................................................................6 4. DEVELOPING A SIMPLE APPLICATION ..............................................................................................................................7 4.1. RUNNING THE APPLICATION ON THE EMULATOR...........................................................................................................................................7 4.2. PORTING THE APPLICATION TO THE NOKIA 9200 SERIES COMMUNICATOR ................................................................................................7 5. SKILLS TO LEARN ................................................................................................................................................................8 5.1. EMULATOR’S VIRTUAL PATH SYSTEM AND CLASSPATH CONVENTIONS.........................................................................................................8 5.2. EXECUTABLES TO LAUNCH THE EMULATOR....................................................................................................................................................8 5.3. CUSTOM API FOR CBA BUTTONS.................................................................................................................................................................9 5.4. JAVAPHONE API ........................................................................................................................................................................................12 5.5. PACKAGING APPLICATIONS FOR GENERAL RELEASE...................................................................................................................................13 6. HINTS AND TIPS................................................................................................................................................................ 14 7. DEVELOPING FOR PHONES OTHER THAN THE NOKIA 9200 SERIES COMMUNICATORS ....................................... 18 8. GETTING HELP................................................................................................................................................................... 18 8.1. FORUM NOKIA............................................................................................................................................................................................18 8.2. SYMBIAN DEVELOPER NETWORK ...............................................................................................................................................................18 9. OTHER AVAILABLE LITERATURE ..................................................................................................................................... 18 9.1. FORUM NOKIA............................................................................................................................................................................................18 9.2. SYMBIAN DEVELOPER NETWORK ...............................................................................................................................................................19 9.3. WIRELESS JAVA FOR SYMBIAN DEVICES....................................................................................................................................................19 Copyright © 2002. Nokia Mobile phones. All rights reserved. 2 GETTING STARTED WITH JAVA ON THE NOKIA 9200 SERIES COMMUNICATORS Version 1.0 Disclaimer: Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to the implementation of information presented in this document. Nokia Corporation does not warrant or represent that such use will not infringe such rights. Nokia Corporation retains the right to make changes to this specification at any time without notice. License: A license is hereby granted to download and print a copy of this specification for personal use only. No other license to any other intellectual property rights is granted herein. Copyright © 2002. Nokia Mobile phones. All rights reserved. 3 GETTING STARTED WITH JAVA ON THE NOKIA 9200 SERIES COMMUNICATORS Version 1.0 Symbian developer paper Getting Started with Java on the Nokia 9200 Series Communicator Authors: Martin de Jode, Developer Consultant Colin Turfus, Manager, Symbian Developer Network Revision: 1.0, March 2002 INTRODUCTION The following pages offer an introduction to creating Java applications for Nokia 9200 Series Communicators, including the Nokia 9210 Communicator in Europe and (soon) the Nokia 9290 Communicator in the Americas. These devices are based on the Symbian OS, an open, robust operating system designed specifically for use in data-enabled mobile devices. With full native Java support, there is no need to learn a new language to develop applications for Symbian OS – Java developers are immediately productive, thanks to their existing skills and experience. Java is expected to become the preferred language for developing third-party applications and services on Symbian OS. It provides a powerful programming environment, and key Symbian OS technologies, such as telephony, contacts management, calendaring, datagram messaging, and IR comms are exposed through the JavaPhone APIs. Furthermore, Java applications can have the look and feel of Symbian OS devices. This paper assumes that the reader has no prior specific knowledge of Symbian OS, but it does presume familiarity with Java and the Nokia 9200 Series Communicators SDK for Symbian OS (Java edition). The SDK, which can be requested on the Forum Nokia developer web site (http://www.forum.nokia.com/), is essential for developing, testing, and debugging Java applications. It provides documentation, tools and sample code to assist developers, along with a Microsoft Windows hosted emulator of the Nokia 9200 Series Communicators. Below you will find a brief overview of the main components that work to make an application suitable for use on the Nokia 9200 Series Communicators. We will outline in detail the code for a basic example application and the key concepts. Minimal treatment is given to the Symbian OS tool chain or the development environment used to create applications, as more comprehensive system documentation is provided with the SDK. 1. JAVA CAPABILITIES OF NOKIA 9200 SERIES COMMUNICATORS The Java functionality available in Nokia 9200 Series Communicators is similar to, and indeed exceeds in a number of areas, that which is typically available in a desktop environment. Furthermore, it rivals the capabilities available to native C++ application developers, while the support available for Java Native Interface programming reduces this gap still further. The Java environment on Nokia 9200 Series Communicators devices is based on the PersonalJava Application Environment, implementing Sun’s version 1.1.1 specification based on its 3.0.1 reference implementation and legacy code from Symbian’s Version 5 Java Runtime. PersonalJava (or pJava) is similar to Standard Java as embodied in JDK 1.1 (see http://java.sun.com/products/personaljava/index.html). The main difference is that Copyright © 2002. Nokia Mobile phones. All rights reserved. 4 GETTING STARTED WITH JAVA ON THE NOKIA 9200 SERIES COMMUNICATORS Version 1.0 certain functional components – packages, classes or methods – that are obligatory in Standard Java, are optional inPersonalJava, reducing the minimum ROM budget for handheld devices like PDAs and mobile phones. Symbian’s PersonalJava implementation also adds some functionality, such as timers. However, Symbian has opted for a fairly complete PersonalJava API set, implementing virtually all optional components including RMI and JDBC support. Over and above the standard Java functionality, Symbian OS also provides an implementation of the JavaPhone 1.0 API that gives Java programs access to a selection of invaluable native services on the device. These include the following: Java Telephony API – Allows Java programs