Using Ant and Antenna to
Build MIDP Applications
F O R U M N O K I A
Version 1.0; March 3, 2003
Technology
Forum.Nokia.com
Using Ant and Antenna to Build MIDP Applications
1
Contents
1 Introduction...........................................................................................................................................................5
1.1 Why Ant....................................................................................................................................................5
1.2 Topics ........................................................................................................................................................5
1.3 Software and System Configuration................................................................................................5
1.4 Nokia Emulators.....................................................................................................................................6
2 Test Case .................................................................................................................................................................6
2.1 Animation.java .......................................................................................................................................6
2.2 AnimationCanvas.java..........................................................................................................................7
2.3 AnimateTimerTask.java.................................................................................................................... 10
2.4 JAD and Manifest Files ....................................................................................................................... 11
2.5 Build the MIDlet................................................................................................................................... 11
2.5.1 Directory Hierarchy .......................................................................................................... 11
2.5.2 Compile................................................................................................................................ 12
2.5.3 Preverify .............................................................................................................................. 12
2.5.4 Package (JAR)..................................................................................................................... 12
2.5.5 Run with Wireless Toolkit Emulator ........................................................................... 12
2.5.6 Run with Nokia Emulator............................................................................................... 13
3 Ant.......................................................................................................................................................................... 15
3.1 Download and Install ........................................................................................................................ 15
3.2 The Build File........................................................................................................................................ 16
3.2.1 Project.................................................................................................................................. 16
3.2.2 Target and Task................................................................................................................. 16
3.2.3 Properties............................................................................................................................ 17
3.3 Running Ant ......................................................................................................................................... 17
3.4 Test Case using Ant ............................................................................................................................ 18
3.5 Review of Ant Tasks........................................................................................................................... 19
4 Ant and Antenna................................................................................................................................................ 20
4.1 Antenna Tasks ..................................................................................................................................... 21
4.2 Download and Install ........................................................................................................................ 21
Forum.Nokia.com
Using Ant and Antenna to Build MIDP Applications
2
4.3 New Build File...................................................................................................................................... 21
4.4 Property Definitions........................................................................................................................... 23
4.5 wtkbuild Task ...................................................................................................................................... 23
4.6 wtkjad.................................................................................................................................................... 23
4.7 wtkpackage Task................................................................................................................................ 24
4.8 wtkrun Task.......................................................................................................................................... 24
4.9 Directory Hierarchy ............................................................................................................................ 25
5 Summary.............................................................................................................................................................. 25
Forum.Nokia.com
Using Ant and Antenna to Build MIDP Applications
3
Change History
3 June 2003
V1.0
Initial document release
Forum.Nokia.com
Using Ant and Antenna to Build MIDP Applications
4
Copyright © 2003 Nokia Corporation. All rights reserved.
Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation. Java and all Java-based marks are
trademarks or registered trademarks of Sun Microsystems, Inc. Other product and company names mentioned herein
may be trademarks or trade names of their respective owners.
Disclaimer
The information in this document is provided “as is,” with no warranties whatsoever, including any warranty of
merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal,
specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed
substantially prior to final release. This document is provided for informational purposes only.
Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to
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.