Download Print this page

Motorola E680 - Smartphone - GSM Developer's Manual

Micro edition (j2me) applications
Hide thumbs


Technical Manual
Motorola E680 Handset
J2ME™ Developer Guide
Version 1.5



  Also See for Motorola E680 - Smartphone - GSM

  Related Manuals for Motorola E680 - Smartphone - GSM

  Summary of Contents for Motorola E680 - Smartphone - GSM

  • Page 1 Technical Manual Motorola E680 Handset J2ME™ Developer Guide Version 1.5...
  • Page 2: Table Of Contents

    Table of Contents TABLE OF CONTENTS ..........................2 1 INTRODUCTION ............................6 ..............................6 URPOSE ..............................6 UDIENCE ..............................6 ISCLAIMER ..............................7 EFERENCES ............................ 8 EVISION ISTORY ..................... 8 EFINITIONS BBREVIATIONS CRONYMS ..........................9 OCUMENT VERVIEW 2 J2ME INTRODUCTION......................... 11 (J2ME)................
  • Page 3 Table of Contents 9 JSR 184 ..............................29 ..............................29 VERVIEW 3D API ............................29 OBILE Mobile 3D API File Format Support ................30 Mobile 3D Graphics – M3G API ................... 30 10 VIBE AND BACKLIGHT API ......................38 API........................38 IBE AND ACKLIGHT 11 JAVA.LANG IMPLEMENTATION......................
  • Page 4 setDialerListener ........................75 startCall ............................75 startCall ............................76 sendExtNo ............................76 endCall ............................. 76 ........................77 NTERFACE IALER ISTENER ................... 77 AMPLE IALER ISTENER MPLEMENTATION notifyDialerEvent ........................79 ............................ 79 LASS IERARCHY ..........................79 NTERFACE IERARCHY 18 DRM PROTECTION IN JAVA ......................80 ..............................
  • Page 5 Table of Contents ..........................102 VAILABLE EMORY ....................102 EMORY ALCULATION FOR LETS APPENDIX D: FAQ ..........................103 FAQ............................103 NLINE APPENDIX E: HTTP RANGE ....................... 104 ........................... 104 RAPHIC ESCRIPTION APPENDIX F: SPEC SHEET ....................... 105 ..........................105 E680 S HEET...
  • Page 6: Introduction

    J2ME applications for the E680 handset. Disclaimer Motorola reserves the right to make changes without notice to any products or services described herein. “Typical” parameters, which may be provided in Motorola Data sheets and/or specifications can and do vary in different applications and actual performance may vary.
  • Page 7: References

    Motorola was negligent regarding the designing or manufacture of the product or service. Motorola recommends that if you are not the sole author or creator of the graphics, video, or sound, you obtain sufficient license rights, including the rights under all patents, trademarks, trade names, copyrights, and other third party proprietary rights.
  • Page 8: Revision History

    RFC 2437 Sun J2ME Revision History Version Date Name Reason January 14, 2004 Motorola Initial Draft February 1, 2004 Motorola Revised Draft February 10, 2004 Motorola Revised Draft February 16, 2004 Motorola Updated TOC March 1, 2004...
  • Page 9: Document Overview

    Chapter 2 – J2ME Introduction: this chapter describes the J2ME platform and the available resources on the Motorola E680 handset. Chapter 3 – Developing and Packaging J2ME Applications: this chapter describes important features to look for when selecting tools and emulation environments. It also describes how to package a J2ME application, how to package a MIDlet, and generate JAR and JAD files properly.
  • Page 10 Appendix A – Key Mapping: this appendix describes the key mapping of the Motorola E680 handset, including the key name, key code, and game action of all Motorola keys. Appendix B – Memory Management Calculation: this appendix describes the memory management calculations.
  • Page 11: J2Me Introduction

    J2ME Introduction J2ME Introduction The Motorola E680 handset includes the Java™ 2 Platform, Micro Edition, also known as the J2ME platform. The J2ME platform enables developers to easily create a variety of Java applications ranging from business applications to games. Prior to its inclusion, services or applications residing on small consumer devices like cell phones could not be upgraded or added to without significant effort.
  • Page 12: The Motorola J2Me Platform

    The Motorola E680 handset contain OEM APIs for extended functionality ranging from enhanced UI to advanced data security. While the Motorola E680 handset can run any application written in standard MIDP, it can also run applications that take advantage of the unique functionality provided by these APIs.
  • Page 13 J2ME Introduction Additional Functionality • WMA (JSR 120) • MMA (JSR 135) • M3D (JSR 184) • Fun Lights API • Phonebook API • File System API • Telephony API...
  • Page 14: Developing And Packaging J2Me Applications

    MIDlets for J2ME handsets. There is a wealth of material on this subject on websites maintained by Motorola, Sun Microsystems and others. Please refer to the following URLs for more information:
  • Page 15 For a look at such environments, review the “Motorola T720 Handset Developer Guide” which is available from the MOTOCODER website. In addition to the IDEs and Sun SDK for development, Motorola offers access to our own SDK which contains Motorola device emulators. From here, a MIDlet can be built and then deployed onto an emulated target handset.
  • Page 16: Downloading Applications

    Downloading Applications Method of Downloading The option open to the developer for deploying the MIDlet to a physical Motorola device is OTA (over -the-air) downloading. To use the OTA method, the developer will have a connection through a wireless network to a content server.
  • Page 17 Package invalid.” To dismiss this dialog, press “OK”. If JAD does not contain mandatory attributes, “Installation failed. Package invalid.” notice appears. The USER-AGENT String The following table describes USER_AGENT strings associated with Motorola devices: Motorola Device USER_AGENT STRING E680 User-Agent: MOT-E680/xx.xx.xx MIB/2.2 Profile/MIDP-2.0...
  • Page 18: Error Logs

    This table above provides information about the following components: 1. WAP Browser Release, Motorola Internet Browser (MIB) 2.2 2. MIDP version 2.0 3. CLDC version 1.1 4. The Phone Software Version is detailed by xx.xx.xx Error Logs The following table represents the error logs associated with downloading applications.
  • Page 19 Downloading Applications Different Version OTA JAR MIDlet version on handset supercedes version Exists Download being downloaded Failed File Corrupt Installation Attributes are not identical to respective JAD attributes Insufficient Storage Installation Insufficient Program Space or Data Space to 901 Memory install suite Full.
  • Page 20: Application Management

    Downloading a JAR file without a JAD In Motorola’s MIDP 2.0 implementation, a JAR file can be downloaded without a JAD. In this case, the user clicks on a link for a JAR file, the file is downloaded, and a confirmation will be obtained before the installation begins.
  • Page 21: Installation And Deletion Status Reports

    Application Management Installation and Deletion Status Reports The status (success or failure) of an installation, upgrade, or deletion of a MIDlet suite will be sent to the server according to the JSR 118 specification. If the status report cannot be sent, the MIDlet suite will still be enabled and the user will be allowed to use it.
  • Page 22: Multiple Applications

    Multiple Applications Multiple Applications Since the Motorola E680 is a Linux based device, multiple tasks are allowed to run at the same time. If the focus is out, the MIDlet method pauseApp () will be called. From there, the developer will decide what happens next as the VM continues to run. If the focus is in, the application will start from MIDlet method startApp ().
  • Page 23: Jad Attributes

    Allows configuration-specific attributes (parameters) to be supplied to the MIDlet(s) without modifying the JAR file. Motorola has implemented the following support for the MIDP 2.0 Java Application Descriptor attributes as outlined in the JSR-118. The table below lists all MIDlet attributes, descriptions, and its location in the JAD and/or JAR manifest that are supported in the Motorola implementation.
  • Page 24 MIDlet suite. MIDlet-Delete-Confirm A text message to be provided to the user when prompted to confirm deletion of the MIDlet suite. Background MIDlets with this Motorola specific attribute will continue to run when not...
  • Page 25 JAD Attributes in focus.
  • Page 26: Gaming Api/Multiple Key Press

    Left Pressed + Fire Pressed. In the same way, when the 2 keys are released, Java object (e.g. Canvas) will receive Left Released + Fire Released. The following sets of keys will support multi-button press support on the Motorola E680 handset. Multi-button press within each set will be supported, while multi-button press across these sets or with other keys will not be supported.
  • Page 27 Gaming API/Multiple Key Press Refer to the table below for gaming and keypad feature/class support for MIDP 2.0: Feature/Class Implementation package Supported setBacklight as defined in javax.microedition.lcdui.Display Supported setVibrator as defined in javax.microedition.lcdui.Display Supported All constructors and inherited classes for the IllegalStateException in Supported java.lang All constructors, methods, and inherited classes for the Timer class in...
  • Page 29: Jsr 184

    JSR 184 requires a J2ME device supporting MIDP 2.0 and CLDC 1.1 at a minimum. Mobile 3D API The Motorola E680 contains full implementation of JSR 184 Mobile 3D API ). The Motorola E680 has also implemented the following: •...
  • Page 30: Mobile 3D Api File Format Support

    Mobile 3D API File Format Support The Motorola E680 supports both M3G and PNG file formats for loading 3D content. The E680 supports the standard .m3g and .png extensions for its file formats. Mime type and not extension will be used for identifying file type. In the case that the Mime type is not available, M3G files will be identified using the file identifier and PNG files using signature.
  • Page 31 JSR 184 Most M3G applications use an M3G resource file that contains all the information required to define the 3D resources, such as objects, their appearance, lights, cameras and animations, in a scene graph. The file must be loaded into memory where object properties can be interrogated and altered using the M3G API.
  • Page 32 The World object contains the objects that define a complete 3D scene - geometry, textures, lights, cameras, and animations. The World object mediates access to the objects within the world. It can be passed as a block to the renderer, the Graphics3D class.
  • Page 33 JSR 184 Initializing the world The Loader class is used to initialize the world. It has two static methods: one takes in a byte array, while the other takes a named resource, such as a URI or an individual file in the JAR package.
  • Page 34 1")); // Assume the world is the first root node loaded. myWorld = (World) roots[0]; catch(Exception e) e.printStackTrace(); // Force a repaint so the update loop is started. myCanvas.repaint(); Using the Graphics3D object Using the Graphics3D is very straightforward. Get the Graphics3D instance, bind a target to it, render everything, and release the target.
  • Page 35 JSR 184 The finally block makes sure that the target is released and the Graphics3D can be reused. The bindTarget call must be outside the try block, as it can throw exceptions that will cause releaseTarget to be called when a target has not been bound, and releaseTarget throwing an exception.
  • Page 36 Animations As well as controlling objects from code, scene designers can specify how objects should move under certain circumstances, and store this movement in “canned” or block animation sequences that can be triggered from code. Many object properties are animatable, including position, scale, orientation, color and textures. Each of these properties can be attached to a sequence of keyframes using an AnimationTrack.
  • Page 37 JSR 184 Authoring M3G files You can create all your M3G content from code if necessary but this is likely to be very time consuming and does not allow 3D artists and scene designers to easily create and rework visually compelling content with complex animations. You can use professional, visual development tools such as Swerve Studio or Swerve M3G exporter from...
  • Page 38: Vibe And Backlight Api

    Vibe and Backlight API Vibe and Backlight API The Vibe and Backlight API allows J2ME applications access to vibrator, backlight, and keypad controls. This API gives a MIDlet the ability to turn these features on or off based on the applications needs. The MIDlet will use this API to enhance the activity being performed by the application.
  • Page 39 Vibe and Backlight API Sample of code for calling of ‘flashBacklight(int)’ method of Display class: int duration = 30000;// 30 seconds; java.lang.boolean returnValue = display.flashBacklight(duration); if (returnValue != false) { System.out.println("Invoke flashBacklight method with parameter = " + duration + ", method returns : " + returnValue);...
  • Page 40: Java.lang Implementation

    Java.lang Implementation java.lang support Motorola implementation for the java.lang.System.getProperty method will support additional system properties beyond what is outlined in the JSR 118 specification and is controlled by a flex bit. These additional system properties can only be accessed by trusted MIDlets.
  • Page 41: Network Apis

    Network APIs Network APIs Network Connections The Motorola implementation of Networking APIs will support several network connections. The network connections necessary for Motorola implementation are the following: • CommConnection for serial interface • HTTP connection • HTTPS connection • Refer to the table below for Network API feature/class support for MIDP 2.0:...
  • Page 42 Connector class in the Supported Dynamic DNS allocation through DHCP Supported HttpConnection interface in the Supported HttpsConnection interface in the Supported SecureConnection interface in the Supported SecurityInfo Interface in the Supported ServerSocketConnection interface in the Supported UDPDatagramConnection interface in the Supported
  • Page 43: User Permission

    Network APIs bytes_left); if (bytes_read > 0) offset += bytes_read; bytes_left -= bytes_read; while (bytes_read > 0); } catch (Exception ex) { System.out.println("IO failed: "+ ex.getMessage()); finally { closeAllStreams(i); //clean up User Permission The user of the handset will explicitly grant permission to add additional network connections.
  • Page 44: Https Connection

    HTTPS Connection Motorola implementation supports a HTTPS connection on the Motorola E680 handset. Additional protocols that will be supported are the following: • TLS protocol version 1.0 as defined in • SSL protocol version 3.0 as defined in
  • Page 45 Network APIs bytes_read = is[i].read(buffer, offset, bytes_left); offset += bytes_read; bytes_left -= bytes_read; byteCounts[i] += bytes_read; while (bytes_read > 0); System.out.println("byte read = " + byteCounts[i]); } catch (Exception ex) { System.out.println("Downloading Failed: "+ ex.getMessage()); numPassed = 0; finally { try { is[i].close();...
  • Page 46: Jsr 135 Mobile Media Api

    JSR 135 Mobile Media API JSR 135 Mobile Media API The JSR 135 Mobile Media APIs feature sets are defined for five different types of media. The media defined is as follows: • Tone Sequence • Sampled Audio • MIDI When a player is created for a particular type, it will follow the guidelines and control types listed in the sections outlined below.
  • Page 47 JSR 135 Mobile Media API player.realize(); catch (MediaException e) System.out.println("FAILED: exception for realize: " + e.toString()); // Acquire exclusive resources, fill buffers with media data player.prefetch(); catch (MediaException e) System.out.println("FAILED: exception for prefetch: " + e.toString()); // Start the media playback player.start();...
  • Page 48: Tonecontrol

    ToneControl ToneControl is the interface to enable playback of a user-defined monotonic tone sequence. The JSR 135 Mobile Media API will implement public interface ToneControl. A tone sequence is specified as a list of non-tone duration pairs and user-defined sequence blocks and is packaged as an array of bytes. The setSequence() method is used to input the sequence to the ToneControl.
  • Page 49: Volumecontrol

    JSR 135 Mobile Media API VolumeControl VolumeControl is an interface for manipulating the audio volume of a Player. The JSR 135 Mobile Media API will implement public interface VolumeControl. The following describes the different volume settings found within VolumeControl: • Volume Settings - allows the output volume to be specified using an integer value that varies between 0 and 100.
  • Page 50: Audio Media

    Audio Media The following multimedia file formats are supported: File Type CODEC SP MIDI General MIDI MIDI Type 1 General MIDI MPEG-1 layer III MIDI Type 0 General MIDI The following is a list of audio MIME types supported: Category Description MIME Type Audio/Video/Image...
  • Page 51 JSR 135 Mobile Media API All fields and methods for the PlayerListener interface in Supported PlayerListener OEM event types for the PlayerListener interface Standard types only All fields, methods, and inherited methods for the Manager Class in Supported TONE_DEVICE_LOCATOR support in the Manager class of Supported
  • Page 52: Jsr 120 - Wireless Messaging Api

    JSR 120 – Wireless Messaging Wireless Messaging API (WMA) Motorola has implemented certain features that are defined in the Wireless Messaging API (WMA) 1.0. The complete specification document is defined in JSR 120. The JSR 120 specification states that developers can be provided access to send (MO –...
  • Page 53: Sms Port Numbers

    JSR 120 – Wireless Messaging API can be opened in either server or client mode. A server MessageConnection connection is opened by providing a URL that specifies an identifier (port number) for an application on the local device for incoming messages. (MessageConnection)"sms://:6000");...
  • Page 54: Sms Message Types

    Also, for sending, support for a minimum of three messages is supported. Motorola advises that developers should not send messages that will take up more than three SMS protocol messages unless the recipient’s device is known to support more.
  • Page 55 JSR 120 – Wireless Messaging API Feature/Class Implementation JSR-120 API. Specifically, APIs defined in the Supported javax.wireless.messaging package will be implemented with regards to the GSM SMS Adaptor All fields, methods, and inherited methods for the Connector Class in Supported the package All methods for the BinaryMessage interface in the Supported...
  • Page 56 public byte[] createBinary(int size) { int nextByte = 0; byte[] newBin = new byte[size]; for (int i = 0; i < size; i++) { nextByte = (rand.nextInt()); newBin[i] = (byte)nextByte; if ((size > 4) && (i == size / 2)) { newBin[i-1] = 0x1b;...
  • Page 57 JSR 120 – Wireless Messaging API Getting of payload data of received binary message: BinaryMessage binMsg; byte[] payloadData = binMsg.getPayloadData(); Setting of address with port number: message.setAddress("sms://+18473297274:9532"); Setting of address without port number: message.setAddress("sms://+18473297274"); Sending of message: messageConnection.send(message); Receiving of message: Message receivedMessage = messageConnection.receive();...
  • Page 58 byte[] newBin = new byte[size]; for (int i = 0; i < size; i++) { nextByte = (rand.nextInt()); newBin[i] = (byte)nextByte; if ((size > 4) && (i == size / 2)) { newBin[i-1] = 0x1b; newBin[i] = 0x7f; return newBin; byte[] newBin = createBinary(msgLength);...
  • Page 59 JSR 120 – Wireless Messaging API Runnable { private int messages = 0; public void notifyIncomingMessage(MessageConnection connection) { System.out.println("Notification about incoming message arrived"); messages++; public void run() { try { messageConnection.setMessageListener(listener); } catch (IOException e) { result = FAIL; System.out.println("FAILED: exception while setting listener: "...
  • Page 60: Phonebook Access Api

    The primary goal of the Phonebook Access API is to be simple and thin to fit in resource- limited devices like the Motorola E680 handset. This API will specify a base storage class for all types of contacts items presented in the vCard specification (RFC2426 –vCard MIME Directory Profile –...
  • Page 61 Phonebook Access API In the Motorola E680, Phonebook API permissions have been added to the MIDP 2.0 security framework “com.motorola.phonebook.” The behavior is up to the domain setting where the MIDlet falls in. For an untrusted MIDlet, the permission for the API is “Oneshot”.
  • Page 62 // get total number of records int numberRecsInPhone = PhoneBookRecord.getNumberRecords(PhoneBookRecord.PHONE_MEMOR int numberRecsInSim = PhoneBookRecord.getNumberRecords(PhoneBookRecord .SIM_MEMORY); int numberRecsAll = PhoneBookRecord.getNumberRecords(PhoneBookRecord.ALL_MEMORY) Sample of code for calling of ‘getAvailableRecords(int device)’ method: // get number of available records int numberRecsAvalPhone = PhoneBookRecord.getAvailableRecords(PhoneBookRecord.PHONE_ME MORY); int numberRecsAvalSim = PhoneBookRecord.getAvailableRecords(PhoneBookRecord.SIM_MEMO RY);...
  • Page 63 Phonebook Access API Sample of code for calling of ‘getMaxTelNoLength (int device)’ method: int maxTelNoLengthPhone = PhoneBookRecord.getMaxTelNoLength(PhoneBookRecord.PHONE_MEMO RY); int maxTelNoLengthSim = PhoneBookRecord.getMaxTelNoLength(PhoneBookRecord.SIM_MEMORY int maxTelNoLengthAll = PhoneBookRecord.getMaxTelNoLength(PhoneBookRecord.ALL_MEMORY Sample of code for calling of ‘getMaxEmailLength ()’ method: int maxEmailLength = PhoneBookRecord.getMaxEmailLength(); Sample of code for calling of ‘getIndexBySpeedNo(int speedNo)’ method: int speedNo = 1;...
  • Page 64 int speedNo = 1; boolean res = PhoneBookRecord.isPrimary(speedNo); Sample of code for calling of ‘fromVFormat(InputStream in, int device)’ method: buffer = new String("BEGIN:VCARD\r\nN:;" + new String(name) "\r\nTEL;TYPE=WORK:1\r\nEND:VCARD\r\n"); int num = PhoneBookRecord.fromVFormat((InputStream)(new ByteArrayInputStream(buffer.getBytes())), PhoneBookRecord.PHONE_MEMORY); Sample of code for calling of ‘toVFormat(OutputStream out, int index, int outFormat, int sortOrder)’...
  • Page 65: File System Access Api

    File System Access API File System Access API The File System Access API for the Motorola E680 handset is intended to allow J2ME applications access to files that are stored on the handsets. Internal file systems can be accessed via the File System Access API. Please note that the maximum file name length supported by Motorola is 36 characters.
  • Page 66: Connection Behavior

    The file connection defines the first directory as the root, which corresponds to a logical mount point for a particular storage unit or memory. The root of a file system supporting only one card reader will return the contents of the card directly. If more than one card reader is supported, or the device supports a file system in RAM, the root strings are device specific.
  • Page 67 File System Access API Sample for FileConnection Interface import*; import*; Get a root of file system java.lang.String root = FileSystemRegistry.listRoots()[0]; * Create a FileConnection object pointing to root directory FileConnection fc = null; try { fc = (FileConnection)"file://"+root);...
  • Page 68 … if (fc.isDirectory()) { // first item is directory else { //first item is file * Create a FileConnection object pointing to file FileConnection fc = null; try { fc = (FileConnection)"file://"+root+"testfile.txt"); } catch (IOException ioe) { … * If file does not exists, create it if (! fc.exists() ) { try { fc.create();...
  • Page 69 File System Access API … * Get file size try { long fileSize = fc.fileSize(); } catch (IOException ioe) { … * Set file's attributes try { boolean isSetToWrite = fc.setWriteable(true); } catch (IOException ioe) { … try { boolean isSetToRead = fc.setReadable(true); } catch (IOException ioe) { …...
  • Page 70 boolean isRenamed = fc.rename("file://"+root+"newfile.txt"); * Get path and URL of file java.lang.String filePath = fc.getPath(); java.lang.String fileURL = fc.getURL(); * Get time of last modification long lastModifiedTime = fc.lastModified(); * Delete file boolean isDeleted = fc.delete(); * Close File Connection try { fc.close();...
  • Page 71 File System Access API * remove listener FileSystemRegistry.removeFileSystemListener(listener); /* Implementation of FileSystemListener interface * Method rootAdded(FileSystemEvent e) is invoked when a root is added to the filesystem * Method rootRemoved(FileSystemEvent e) is invoked when a root is removed from the filesystem * To get information about just added/removed roots, the following methods of FileSystemEvent should be used: * - to get event ID:...
  • Page 72: Telephony Api

    Telephony API The Telephony API allows a MIDlet to make a voice call, however, the user needs to confirm the action before any voice call is made. The reason for the confirmation is to provide a measure of security from rogue applications overtaking the handset. Unlike standard TAPI, the wireless Telephony API provide simple function and simple even listener: startCall (), send ExtNo(), and endCall (), DialerListener.
  • Page 73 Telephony API static byte PHONE_VOICECALL_DISCONNECT Phone call was disconnected event static byte PHONE_VOICECALL_DTMF_FAILURE Send extension number error event static byte PHONE_VOICECALL_FAILURE start phone call error event static byte PHONE_VOICECALL_HOLD Current java phone call was held by native phone event static byte PHONE_VOICECALL_INIT Phone start dial-up event static byte PHONE_VOICECALL_TIMEOUT Phone process timeout event...
  • Page 74: Class Dialer

    disconnect ed event PHONE_VOICECALL_TIMEOUT public static final byte Phone PHONE_VOICECALL_TIMEOUT process timeout event PHONE_VOICECALL_HOLD public static final byte Current PHONE_VOICECALL_HOLD java phone call was held by native phone event PHONE_VOICECALL_UNHOLD public static final byte Current PHONE_VOICECALL_UNHOLD java phone call was unheld event PHONE_VOICECALL_DTMF_FAILURE...
  • Page 75: Getdefaultdialer

    Telephony API • equals • getClass • hashCode • notify • notifyAll • toString • wait getDefaultDialer public static Dialer getDefaultDialer() Get a Dialer instance. setDialerListener public void setDialerListener( listener) DialerListener Registers a object. DialerListener The platform will notify this listener object when a phone event has been received to this Dialer object There can be at most one listener object registered for a object at any given...
  • Page 76: Startcall

    - if the call could not be created or because of network failure IOException - if the parameter is null NullPointerException - if the application does not have permission to start the call SecurityException startCall public void startCall( teleNumber, String extNo) String throws...
  • Page 77: Interface Dialerlistener

    Sample DialerListener Implementation Dialer listener program import; import javax.microedition.midlet.*; import*; import com.motorola.*; public class Example extends MIDlet implements DialerListener { Dialer dialer; // Initial tests setup and execution. public void startApp() { try { dialer = Dialer.getDefaultDialer();...
  • Page 78 case DialerEvent.PHONE_VOICECALL_INIT: // your process break; case DialerEvent.PHONE_VOICECALL_FAILURE: // your process break; case DialerEvent.PHONE_VOICECALL_CONNECT: // your process break; case DialerEvent.PHONE_VOICECALL_DISCONNECT: // your process break; case DialerEvent.PHONE_VOICECALL_TIMEOUT: // your process break; case DialerEvent.PHONE_VOICECALL_HOLD: // your process break; case DialerEvent.PHONE_VOICECALL_UNHOLD: // your process break;...
  • Page 79: Notifydialerevent

    Parameters: - the where the TAPI voice call event has arrived dialer Dialer - the TAPI voice call event type. event Class Hierarchy • class java.lang.Object o class o class Interface Hierarchy • interface
  • Page 80: Drm Protection In Java

    DRM Protection in Java Overview Digital Rights Management (DRM) is an approach to protect content against illegal use by packaging the content into an encrypted format with rules dictating its use. With a valid rights object for the specific content file, a DRM application can decrypt the content for playback.
  • Page 81: Cldc 1.1

    CLDC 1.1 CLDC 1.1 This chapter covers the additional functionality of CLDC 1.1 as it pertains to the Motorola E680. This chapter assumes that the developer is aware of CLDC 1.0 and its uses on Motorola handsets. CLDC 1.1 is fully backwards compatible with CLDC 1.0.
  • Page 82 String getName () Returns this thread’s name Void interrupt () Interrupts this thread Java.lan.String Boolean equalIgnoreCase Compares this String (String anotherString) to another String, ignoring case considerations String intern () Returns a cnonical representation for the string object Static String valueOf (float f) Returns the string representation of the float argument...
  • Page 83 CLDC 1.1 the form: Dow mon dd hh:mm:ss zzz yyyy Excption and error New Class; Refer to classes oundError CLDC Specification 1.1 for more details Weak References Java.lang.ref.Reference New Class; Refer to CLDC Specification 1.1 for more details Java.lang.ref.WeakRefe New Class;...
  • Page 84 Static double abs (double a) Returns the absolute calue of a double value Static double ceil (double a) Returns the smallest (closest to negative infinity) double value that is not less than the arguement and is equal to a mathematical integer Static double cos (double a) Returns the trigonometric cosine...
  • Page 85 CLDC 1.1 Static double toradians (double Converts an angle angdeg) measured in degrees to the equivalent angle measured in radians...
  • Page 86: Jtwi

    • At least a JAR file size of 64 KB • At least a RMS data size of 30 KB Any Motorola JTWI device will implement the following and pass the corresponding TCK: • CLDC 1.0 or CLDC 1.1 •...
  • Page 87: Cldc Related Content For Jtwi

    JTWI CLDC related content for JTWI JTWI is designed to be implemented on top of CLDC 1.0 or CLDC 1.1. The configuration provides the VM and the basic APIs of the application environment. If floating point capabilities are exposed to Java Applications, CLDC 1.1 will be implemented. The following CLDC requirements will be supported: •...
  • Page 88: Midp 2.0 Specific Information For Jtwi

    Digit: one of: • 0 1 2 3 4 5 6 7 8 9 NOTE: Hours will be between 0 and 23, and minutes will be between 00 and 50. For example, GMT +10 and GMT +0010 equates to ten hours and ten minutes ahead of GMT. When creating a TimeZone, the specified custom time zone ID is normalized in the following syntax: •...
  • Page 89: Wireless Messaging Api 1.1 (Jsr 120) Specific Content For Jtwi

    JTWI garbage collection) affect the ability to achieve this requirement. At least 80% of test attempts will meet the schedule resolution requirement to achieve acceptable conformance. Minimum Number of Timers will allow a MIDlet to create a minimum of 5 simultaneously running Timers.
  • Page 90: Mobile Media Api 1.1 (Jsr 135) Specific Content For Jtwi

    MIDP 2.0 Security specific content for JTWI • The Motorola E680 follows the security policy outlined in the Security chapter of this developer guide.
  • Page 91: Midp 2.0 Security Model

    MIDP 2.0 Security Model MIDP 2.0 Security Model The following sections describe the MIDP 2.0 Default Security Model for the Motorola E680 handset. The chapter discusses the following topics: • Untrusted MIDlet suites and domains • Trusted MIDlet suites and domains •...
  • Page 92: Untrusted Midlet Suites

    All constructors, methods, and inherited methods for the Supported MIDletStateChangeException class in the javax.microedition.midlet package All constructors and inherited methods for the Supported MIDletStateChangeException class in the javax.microedition.midlet package Please note the domain configuration is selected upon agreement with the operator. Untrusted MIDlet Suites A MIDlet suite is untrusted when the origin or integrity of the JAR file cannot be trusted by the device.
  • Page 93: Trusted Midlet Suites

    API or function. User Permission Interaction Mode User permission for the Motorola E680 handsets is designed to allow the user the ability to either deny or grant access to the protected API or function using the following interaction modes (bolded term(s) is prompt displayed to the user): •...
  • Page 94: Implementation Based On Recommended Security Policy

    Policy The required trust model, the supported domain, and their corresponding structure will be contained in the default security policy for Motorola’s implementation for MIDP 2.0. Permissions will be defined for MIDlets relating to their domain. User permission types, as well as user prompts and notifications, will also be defined.
  • Page 95: Trusted Midlet Suites Using X.509 Pki

    MIDP 2.0 Security Model SMS send “Send SMS?” SMS receive “Receive SMS?” Access phonebook “Use Phonebook?” Dial a call “Make Phone Call?” “Use CBS?” Receive CBS “Receive CBS?” Record audio/video “Record?” Capture snapshot image “Video capture?” Access File System “Using File?” The radio button messages will appear as follows and mapped to the permission types as shown in the table below: MIDP 2.0 Permission Types...
  • Page 96: Signing Amid Let Suite

    Specially designed certificates for code signing can be obtained from the manufacturer, operator, or certificate authority. Only root certificates stored on the handset will be supported by the Motorola E680 handset. Signer of MIDlet Suites The signer of a MIDlet suite can be the developer or an outside party that is responsible for distributing, supporting, or the billing of the MIDlet suite.
  • Page 97: Inserting Certificates Into Jad

    MIDP 2.0 Security Model and return to the signer. If multiple CAs are used, all signer certificates in the JAD will have the same public key. Inserting Certificates into JAD When inserting a certificate into a JAD, the certificate path includes the signer certificate and any necessary certificates while omitting the root certificate.
  • Page 98: Verifying The Signer Certificate

    Verifying the Signer Certificate The signer certificate will be found in the application descriptor of the MIDlet suite. The process for verifying a Signer Certificate is outlined in the steps below: 1. Get the certification path for the signer certificate from the JAD attributes MIDlet- Certificate-1<m>, where <m>...
  • Page 99 MIDP 2.0 Security Model 4. Use the signer’s public key, signature, and SHA-1 digest of JAR to verify the signature. If the signature verification fails, reject the JAD and MIDlet suite. The MIDlet suite will not be installed or allow MIDlets from the MIDlet suite to be invoked as shown in the following table.
  • Page 100: Appendix A: Audio Mix Table

    Appendix A: Audio Mix Table Single Tone- MIDI Video Video tons Sequence w/audio audio Single tone Tone- sequence Partly MIDI Video w/audio Video w/o audio NOTE: If two wave plays have the same frequency, they can mix...
  • Page 101: Appendix B: Key Mapping

    Appendix B: Key Mapping Appendix B: Key Mapping Key Mapping for the E680 The following image identifies keys that will be assigned to game actions defined in GameCanvas class of MIDP 2.0.
  • Page 102: Appendix C: Memory Management Calculation

    Appendix C: Memory Management Calculation Available Memory The available memory on the Motorola E680 handset is the following: • Shared memory for MIDlet storage and removable memory • 2048k Bytest Heap size • Recommended maximum MIDlet size is 1024k Memory Calculation for MIDlets...
  • Page 103: Appendix D: Faq

    The MOTOCODER developer program is online and able to provide access to Frequently Asked Questions around enabling technologies on Motorola products. Access to dynamic content based on questions from the Motorola J2ME developer community is available at the URL listed below.
  • Page 104: Appendix E: Http Range

    Appendix E: HTTP Range Graphic Description The following is a graphic description of HTTP Range:...
  • Page 105: Appendix F: Spec Sheet

    Appendix F: Spec Sheet Appendix F: Spec Sheet E680 Spec Sheet Listed below is the spec sheetsfor the Motorola E680 handset. The spec sheet contains information regarding the following areas: • Technical Specifications • Key Features • J2ME Information •...
  • Page 106 Tools: CLDC v1.0 specifications: CodeWarrior® Wireless Studio v7.0 WAP forum: J2ME™ SDK version v4.0 EMS standards: Motorola Messaging Suite v1.1 Purchase: Documentation: Visit the Motocoder Shop at Creating Media for the Motorola E680 Handset Accessories:
  • Page 107 Appendix F: Spec Sheet MOTOROLA and the Stylized M Logo are registered in the U.S. Patent & Trademark Office. All other product or service names are the property of their respective owners. Java and all other Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.