Nokia 9210 Service Manual

Page of 16
How to develop Java
TM
 Applications for the Nokia 9210 Communicator
Version 1.1
Copyright © 2001. Nokia Mobile phones. All rights reserved.
9
where the c:\jdk1.1.8\lib\classes\ folder contains Symbian classes. More information about
classpath issues with the emulator can be found in the SDK documentation:
Crystal V6 Edition for Java -> Java Developer's Guide for Crystal -> Java Development -> The
default classpath.
4.1  The Source Code
Below is the source code of the amazing Hello World application. The code should be copied to
the file Helloworld.java and compiled with javac.exe.
import
com.symbian.devnet.crystal.awt.*;
import
com.symbian.epoc.awt.*;
import
java.awt.*;
class Helloworld extends CFrame implements CBAListener
{
private static GridPanel panel = new GridPanel();
private CBAHandler cba;
static final String TITLE = "Hello World";
final static int CLOSE_BUTTON = EikCommandButtonGroup.BUTTON4;
public static void main( String args[] )
{
new Helloworld();
}
public Helloworld()
{
setTitle(TITLE);
cba = new CBAHandler( this );
cba.setText( CLOSE_BUTTON, "Close" );
cba.activate();
Font font = new Font("SansSerif",0,30);
Label label = new Label("Hello World!!!");
label.setFont(font);
panel.add(label,0,1);
add(panel);
show();
}
public void cbaActionPerformed( CBAEvent e )
{
switch ( e.getID() )
{
case CLOSE_BUTTON:
shutDown();
break;
}
}
}
4.2  Symbian Platform Specific Processes
Certain procedures must be followed to make the Hello World application visible in the emulator
and the target machine.  One must use the tool applications included with the SDK. The AIF
Builder tool writes certain files needed for the Symbian operating system and the makesis.exe