F O R U M N O K I A
MIDP: Wireless Messaging API 2.0 Developer's Guide
Version 2.0; October 31st, 2006
Java™
Change history
October 2006 Version 2.0 This document is based on MIDP: Wireless Messaging
API Developer's Guide, version 1.0, earlier published
on Forum Nokia at http://www.forum.nokia.com/.
The structure of the document has been harmonized
and other minor updates have been made. In
addition, some code comments have been added to
the example Java code.
Forum.Nokia.com
MIDP: Wireless Messaging API 2.0 Developer's Guide 2
Copyright © 2006 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.
Forum.Nokia.com
MIDP: Wireless Messaging API 2.0 Developer's Guide 3
Contents
1 About this Document...........................................................................................................................................5
2 Wireless messaging in Java ME...........................................................................................................................6
3 Wireless Messaging API 2.0 overview.................................................................................................................7
4 Using the Wireless Messaging API 2.0................................................................................................................9
5 Example: Creating and sending MMS messages..............................................................................................11
5.1 User Interface.............................................................................................................................................11
5.2 Prerequisites..............................................................................................................................................13
5.3 Implementing the MMS MIDlet.................................................................................................................13
5.4 Developing the MMS MIDlet......................................................................................................................13
5.4.1 Creating the project environment...................................................................................................13
5.4.2 Implementing the MMSMIDlet class................................................................................................14
5.4.3 Implementing the SendScreen class...............................................................................................17
5.4.4 Implementing the ReceiveScreen class..........................................................................................19
5.4.5 Implementing the CameraScreen class...........................................................................................21
5.4.6 Implementing the InfoScreen class................................................................................................23
5.4.7 Building and running in an emulator.............................................................................................23
5.4.8 Deploying to a device.......................................................................................................................24
Forum.Nokia.com
MIDP: Wireless Messaging API 2.0 Developer's Guide 4
1 About this Document
This document demonstrates the use of the Wireless Messaging API 2.0 by briefly describing the API and
presenting an example MIDlet, which sends and receives MMS messages.
With the example MIDlet, the user can capture an image using the device camera and then send this image
along with an accompanying textual note as a multimedia message to a given phone number. Received
messages are displayed on the screen.
This document assumes that you are familiar with Java™ programming and understand the basics of MIDP
programming.
Scope
This document is intended for MIDP developers, as well as Java™ EE and Java SE developers wishing to use
the S60 and Series 40 Platforms for developing mobile Java applications or services. The reader should be
familiar with MIDP 2.0 before attempting to understand this example.
Familiarity with the SMS capabilities of the Wireless Messaging API is recommended as well - this can be
achieved by reading the Forum Nokia document A MIDlet Example Using the Wireless Messaging API and
the Nokia SMS API: Chat at
http://www.forum.nokia.com/info/sw.nokia.com/id/
b15230a7-56fb-412b-82f9-de9a501f5d16/
A_MIDlet_Example_Using_the_WMA_and_the_Nokia_SMS_API_v1_0.pdf.html. Knowledge of the basics of
wireless SMS messaging and MMS messaging is also recommended.
Intended audience
This document assumes a good knowledge of application and service development and the Java
programming language. Furthermore, it assumes familiarity with enterprise application development.
However, previous knowledge of developing for the mobile environment is not necessary.
This document focuses on wireless messaging and therefore explaining the Java technology is out of the
scope of this documentation. For information on Java technology, see Java Technology web site at http://
java.sun.com/ and Java Mobility Development Center at http://developers.sun.com/techtopics/mobility/.
For additional information on MIDP tools and documentation, see Forum Nokia, Mobile Java section at
http://www.forum.nokia.com/main/resources/technologies/java/.
Forum.Nokia.com
MIDP: Wireless Messaging API 2.0 Developer's Guide 5