Technical Manual Version 01.00 Motorola C381p Handset J2ME™ Developer Guide
1 Introduction 10 1 Introduction Purpose This document describes the application program interfaces used to develop Motorola compliant Java™ 2 Platf
25 Auto Launch of Midlets 100 25 Auto Launch of Midlets The Java framework on the device must provide a mechanism to automatically launch midlets ba
26 Background Applications 101 26 Background Applications Background Attribute A Motorola specific JAD attribute called background exists. MIDlets w
26 Background Applications 102 Figure 13 Java service menu for a MIDlet with background attributes Pressing the EN
27 Java System Menu 103 27 Java System Menu The Java System menu allows the user to see what version of MIDP and CLDC is being used in the phone. It
27 Java System Menu 104 View MIDlet Suite Information To view information on any MIDlet suite, the user brings up the MIDlet Manager menu. The user
27 Java System Menu 105 highlights the Delete option and SELECTs it to delete the suite. This brings up a confirmation dialog. Upon confirmation by
27 Java System Menu 106 • If the application name is longer than 12 characters, it must be truncated. The “Delete Entire Suite and All data?” text
28 Invisible Net for J2ME 107 28 Invisible Net for J2ME Introduction This chapter presents the Invisible Net for J2ME feature for multi line graphi
28 Invisible Net for J2ME 108 • URLs associated with J2ME menus or components will be launched using one of the following methods: o HTTP download
28 Invisible Net for J2ME 109 o CxD media team will provide or approve any J2ME menu icons or graphics. o Rendering guidelines for J2ME menu prom
1 Introduction 11 in connection with the ability or inability to use the Products, to the full extent these damages may be disclaimed by law. Some s
28 Invisible Net for J2ME 110 • A developer may embed a URL within a context-sensitive menu. Because the prompts and URLs in this MRS are variable
29 Download Midlet through PC 111 29 Download Midlet through PC To download MIDlets through a PC, make a connection to a PC through IrDA, Bluetooth,
30 Operator Apps Provisioning 112 30 Operator Apps Provisioning The application provisioning feature uses the existing functionality to deliver a t
31 MIDP 2.0 Security Model 113 31 MIDP 2.0 Security Model The following sections describe the MIDP 2.0 Default Security Model for the Motorola C381p
31 MIDP 2.0 Security Model 114 MIDletStateChangeException class in the javax.microedition.midlet package All constructors and inherited methods for
31 MIDP 2.0 Security Model 115 Trusted MIDlet Suites Trusted MIDlet suites are MIDlet suites in which the integrity of the JAR file can be authentic
31 MIDP 2.0 Security Model 116 • No – will not allow the MIDlet suite access to the requested API or function that is protected. (No Access) The pr
31 MIDP 2.0 Security Model 117 Dial a call “Make Phone Call?” CBS “Use CBS?” Receive CBS “Receive CBS?” Table 27 Protected Functionality fot top
31 MIDP 2.0 Security Model 118 operator, or certificate authority. Only root certificates stored on the handset will be supported by the Motorola C3
31 MIDP 2.0 Security Model 119 Inserting Certificates into JAD When inserting a certificate into a JAD, the certificate path includes the signer cer
1 Introduction 12 Revision History Version Date Name Reason 00.01 November 09, 2004 C.E.S.A.R. Initial Draft Definitions
31 MIDP 2.0 Security Model 120 attribute with this name. The value of each attribute is abase64 encoded certificate that will need to be decoded and
31 MIDP 2.0 Security Model 121 The Table 30 is a summary of MIDlet suite verification including dialog prompts: Initial State Verification Result
Appendix A: Audio Mix Table 122 Appendix A: Audio Mix Table Single tons Tone-Sequence Wav MP3 AMR MIDI Video w/audio Video w/o audio Single to
Appendix B: Key Mapping 123 Appendix B: Key Mapping Key Mapping for the C381p The table below identifies key names and corresponding Java assignme
Appendix B: Key Mapping 124 The following table identifies keys that will be assigned to game actions defined in GameCanvas class of MIDP 2.0. Ac
Appendix C: Memory Management Calculation 125 Appendix C: Memory Management Calculation Available Memory The available memory on the Motorola C381p
Appendix D: FAQ 126 Appendix D: FAQ Online FAQ The MOTOCODER developer program is online and able to provide access to Frequently Asked Questions
Appendix E: HTTP Range 127 Appendix E: HTTP Range Graphic Description The following is a graphic description of HTTP Range: Figure 16 Description
Appendix F: Spec Sheet 128 Appendix F: Spec Sheet C381p Spec Sheet Listed below is the spec sheet for the Motorola C381p handset. The spec sheet c
Appendix F: Spec Sheet 129 Motorola C381pDeveloper Reference Sheet Band/Frequency GSM 850/900/1800/1900 GPRS Region Global Technology
1 Introduction 13 RTOS Real Time Operating System SDK Software Development Kit SMS Short Message Service SMSC Short Messaging Service Center SU
Appendix F: Spec Sheet 130 MOTOROLA and the Stylized M Logo are registered in the U.S. Patent &
1 Introduction 14 Chapter 14 – SMS Messaging as GSM Extension: this chapter describes the SMS Access API. Chapter 15 – User Display Interface: this
2 J2ME Introduction 15 2 J2ME Introduction The Motorola C381p handset includes the Java™ 2 Platform, Micro Edition, also known as the J2ME platform.
2 J2ME Introduction 16 The Configuration Layer used in the Motorola C381p handset is the Connected Limited Device Configuration 1.1 (CLDC 1.1) and
2 J2ME Introduction 17 Resources and API’s Available MIDP 2.0 will provide support to the following functional areas on the Motorola C381p handset:
3 Developing and Packaging J2ME Applications 18 3 Developing and Packaging J2ME Applications Guide to Development in J2ME Introduction to Developme
3 Developing and Packaging J2ME Applications 19 in development of a MIDlet. The specifications listed above are designed to work upon devices that h
Table of Contents 2 Table of Contents TABLE OF CONTENTS ...
4 Downloading Applications 20 4 Downloading Applications Method of Downloading The option open to the developer for deploying the MIDlet to a physic
4 Downloading Applications 21 904 JAR Size Mismatch 905 Attribute Mismatch 906 Invalid Descriptor 907 Invalid JAR 908 Incompatible Co
4 Downloading Applications 22 Mismatch . Download match the size indicated in JAD 902 User Cancelled. OTA JAR Download User cancelled download Ca
4 Downloading Applications 23 URL of JAR file Not specified Size of JAR file 8 Bytes Max Applicable Terminal Type not specified Application progr
5 Application Management 24 5 Application Management The following sections describe the application management scheme for the Motorola C381p handse
5 Application Management 25 If the user decides to save the data from the current MIDlet, the data will be preserved during the upgrade and the data
5 Application Management 26 Refer to the Table 4 Java System menu: Action Description CLDC Version This displays the CLDC version that is being u
6 JAD Attributes 27 6 JAD Attributes JAD / Manifest Attribute Implementations The JAR manifest defines attributes to be used by the application man
6 JAD Attributes 28 MIDlet-Info-URL A URL for information further describing the MIDlet suite. MIDlet-<n> The name, icon, and class of t
7 Java.lang Implementation 29 7 Java.lang Implementation java.lang support Motorola implementation for the java.lang.System.getProperty method will
Table of Contents 3 JAVA.LANG SUPPORT ...
8 Network APIs 30 8 Network APIs Network Connections The Motorola implementation of Networking APIs will support several network connections. The ne
8 Network APIs 31 SecureConnection interface in the javax.microedition.io.package Supported SecurityInfo Interface in the javax.microedition.io.pac
8 Network APIs 32 } while (bytes_read > 0); } catch (Exception ex) { System.out.p
8 Network APIs 33 try { is[i] = hc[i].openInputStream(); byteCounts[i] = 0; readLengt
8 Network APIs 34 } catch (Exception ex) { } hc[i] = null; } Code Sample 3 HTTPS Connection
9 JSR 135 Mobile Media API 35 9 JSR 135 Mobile Media API JSR 135 Mobile Media API The JSR 135 Mobile Media APIs feature sets are defined for five di
9 JSR 135 Mobile Media API 36 catch (MediaException e) { System.out.println("FAILED: exception for realize: " + e.toString()); } // A
9 JSR 135 Mobile Media API 37 A tone sequence is specified as a list of non-tone duration pairs and user-defined sequence blocks and is packaged as
9 JSR 135 Mobile Media API 38 StopTimeControl StopTimeControl allows a specific preset sleep timer for a player. The JSR 135 Mobile Media API will i
9 JSR 135 Mobile Media API 39 Tone Sequences Audio Audio/x-tone-sequence Table 8 List of audio MIME types Refer to the Table 9 for multimedia fe
Table of Contents 4 CANVAS FUNCTIONALITY...
9 JSR 135 Mobile Media API 40 Note: If two wave plays have the same frequency, they can mix. See Appendix A – mix audio table. Player number limit
10 JSR 120 – Wireless Messaging API 41 10 JSR 120 – Wireless Messaging API Wireless Messaging API (WMA) Motorola has implemented certain features
10 JSR 120 – Wireless Messaging API 42 (MessageConnection)Connector.open("sms://:6000"); Messages received with this identifier will the
10 JSR 120 – Wireless Messaging API 43 SMS Message Types The types of messages that can be sent are TEXT or BINARY, the method of encoding the messa
10 JSR 120 – Wireless Messaging API 44 Feature/Class Implementation JSR-120 API. Specifically, APIs defined in the javax.wireless.messaging package
10 JSR 120 – Wireless Messaging API 45 byte[] newBin = new byte[size]; for (int i = 0; i < size; i++) { nextByte = (rand.nextI
10 JSR 120 – Wireless Messaging API 46 Setting of address without port number: message.setAddress("sms://+18473297274"); Sending of messa
10 JSR 120 – Wireless Messaging API 47 byte[] newBin = createBinary(msgLength); binMsg.setPayloadData(newBin); int num = connClient.numberOfSegmen
10 JSR 120 – Wireless Messaging API 48 " + e.toString()); } } } Code Sample 5 JSR 120 Wireless Messaging API
11 Phonebook Access API 49 11 Phonebook Access API Phonebook Access API Using the Phonebook Access API, an application will be able to locate and u
Table of Contents 5 27 JAVA SYSTEM MENU...
11 Phonebook Access API 50 In the Motorola C381p, Phonebook API permissions have been added to the MIDP 2.0 security framework “com.motorola.phonebo
11 Phonebook Access API 51 Sample of code for calling of ‘getNumberRecords(int device)’ method: // get total number of records int numberRecsInPhon
11 Phonebook Access API 52 int maxTelNoLengthSim = PhoneBookRecord.getMaxTelNoLength(PhoneBookRecord.SIM_MEMORY); int maxTelNoLengthAll = PhoneBoo
11 Phonebook Access API 53 buffer = new String("BEGIN:VCARD\r\nN:;" + new String(name) + "\r\nTEL;TYPE=WORK:1\r\nEND:VCARD\r\n"
12 Telephony API 54 12 Telephony API The Telephony API allows a MIDlet to make a voice call, however, the user needs to confirm the action before an
12 Telephony API 55 Summary static byte PHONE_VOICECALL_CONNECT Phone call was connected event static byte PHONE_VOICECALL_DISCONNECT
12 Telephony API 56 PHONE_VOICECALL_CONNECT public static final byte PHONE_VOICECALL_CONNECT Phone call was connected event PHONE_VOICECALL_DISC
12 Telephony API 57 void sendExtNo(String extNumber) send extension number. void setDialerListener(DialerListener listener)
12 Telephony API 58 startCall public void startCall(String telenumber) throws IOException start a phone call using given telephone nu
12 Telephony API 59 endCall public void endCall() throws IOException end or cancel a phone call Throws: IOException - if the call cou
Table of Figures 6 Table of Figures Figure 1 Java Platform...1
12 Telephony API 60 } Asynchronous callback for receive phone call event public void notifyDialerEvent(Dialer dialer, byte event) {
12 Telephony API 61 notifyDialerEvent public void notifyDialerEvent(Dialer dialer, byte event) Called by the platf
13 Serial Port Access 62 13 Serial Port Access The Serial Port RS232 API is incorporated into any J2ME device allowing connection to the J2ME serial
14 SMS Messaging as GSM Extension 63 14 SMS Messaging as GSM Extension The SMS APIs for J2ME environment enable the following functionality: • Crea
14 SMS Messaging as GSM Extension 64 Viewing a Message The APIs should provide a way to get a list of messages that is associated with a specific a
15 User Display Interface 65 15 User Display Interface The J2ME standard allows specific Canvas, Hardware Mapping and External Event Interaction fun
15 User Display Interface 66 All color types are supported, although the appearance of the image will be dependent on the capabilities of the dev
15 User Display Interface 67 Hardware Mapping The J2ME standard provides a minimum key set that is determined to be available on all devices. These
15 User Display Interface 68 The handset controls the rendering and positioning of these global commands, but the J2ME application determines the a
15 User Display Interface 69 Figure 2 Active Global Commands - Back, Cancel, OK, Help & Stop Example 2: Upon start-up, the
Index of Tables 7 Index of Tables Table 1 Error Logs ...
15 User Display Interface 70 Volume Key Volume keys will not be supported in the first release of J2ME, Java 1.0. In following releases, when the
16 One-Click Application Access 71 16 One-Click Application Access The one-click access to J2ME applications Implementation allows the user to more
16 One-Click Application Access 72 • Large Icons - Until a better solution can be implemented, a generic large animated icon must be created for di
17 Download MIDlet Through Browser 73 17 Download MIDlet Through Browser The Download MIDlet Through Browser requires the browser to be connected be
17 Download MIDlet Through Browser 74 Star Active Browser Session from Main Menu The Figure 4 describes Staring Active Browser Session from Main Men
17 Download MIDlet Through Browser 75 Downloading MIDlets The Figure 5 represents J2ME Application (MIDlets) Download and Installation. Figu
17 Download MIDlet Through Browser 76 • If the DOWNLD softkey is selected, the handset starts downloading the application. The handset displays “Do
17 Download MIDlet Through Browser 77 • During the installation process, if the flip is closed on a flip handset, the installation process will con
17 Download MIDlet Through Browser 78 provided in all MIDlets. Two separate prompts will be displayed depending on whether these attributes are pres
17 Download MIDlet Through Browser 79 Figure 7 Memory full error Rules: • If Mot-Data-Space-Requirements and Mot-Program-Space-Requirements at
Index of Tables 8 Table 26 Security feature/class support for MIDP 2.0... 114 Table 27 Protected Functionality fot top line of pr
17 Download MIDlet Through Browser 80 Figure 8 Mot-Data-Space & Mot-Program-Space attributes are not present or are incorretct Rules: • If M
17 Download MIDlet Through Browser 81 Figure 9 Memory Full help message during installation process Rules: • The installation process is cancel
17 Download MIDlet Through Browser 82 Figure 10 Same Version of Application already exists on the handset Rules: • Handset checks for MIDlet-Nam
17 Download MIDlet Through Browser 83 Figure 11 Latest (Newer) Version of Application exists Rules: • If the latest or newer version of applica
18 Lightweight Windowing Toolkit 84 18 Lightweight Windowing Toolkit LWT integrate with the LCDUI API within the MIDP and enhance the capabilities
19 UDP Support 85 19 UDP Support This functionality is to enable J2ME applications access to Generic UDP Transport Service. • This enhancement all
20 Shared JAD URLs 86 20 Shared JAD URLs Overview Actually, users are able to download J2ME applications. The first step is to download the JAD f
20 Shared JAD URLs 87 Accessing Tell-A-Friend from SMM The MIDlet Manager menu lets the user perform certain actions on the selected MIDlet suites.
20 Shared JAD URLs 88 Figure 12 the MIDlet Manager and the context-sensitive menus Downloading through Browser Rules: • When downloading a J2ME a
20 Shared JAD URLs 89 Downloading through MMS Rules: • When downloading an application via MMS, JAM shall use the JAD attribute Mot-Midlet- URL if
Table of Code Samples 9 Table of Code Samples Code Sample 1 Java.lang support ...2
21 Get URL from Flex API 90 21 Get URL from Flex API Overview This feature allows accessing URL stored in FLEX by a Java application. Carriers fle
21 Get URL from Flex API 91 Security Policy Only trusted applications will be granted permission to access this property.
22 Multiple Key Press 92 22 Multiple Key Press Multi-button press support enhances the gaming experience for the user. Multi-button press support gi
22 Multiple Key Press 93 key. Map the DOWN_PRESSED field in javax.microedition.lcdui.GameCanvas to the bottom position of the key Supported Map the
23 iTAP 94 23 iTAP Intelligent Keypad Text Entry API When users are using features such as SMS (short message service), or “Text Messaging”, they ca
24 LCDUI 95 24 LCDUI LCDUI API The Table 21 lists the specific interfaces supported by Motorola implementation: Interface Description Choice Choic
24 LCDUI 96 visual and interactive elements into Forms. DateField A DateField is an editable component for presenting date and time (calendar) info
24 LCDUI 97 Will provide and play an audible sound when the play Sound() method is called with an AlertType of WARNING Supported Will provide and pl
24 LCDUI 98 package All fields, methods, and inherited methods for the Display class in the javax.microedition.lcdui package Supported Maximum color
24 LCDUI 99 All fields, constructors, methods, inherited fields, and inherited methods for the TextField class in the javax.microedition.lcdui packa
Comments to this Manuals