Technical Manual Motorola C370, C450, and C550 Series of Handsets J2ME™ Developer Guide Version 1.
Table of Contents TABLE OF CONTENTS.......................................................................................................................... 2 1 INTRODUCTION................................................................................................................................. 5 PURPOSE ............................................................................................................................................... 5 AUDIENCE............................................
Table of Contents HTTP.................................................................................................................................................. 33 TCP SOCKETS .................................................................................................................................... 34 UDP SOCKETS .................................................................................................................................... 34 IMPLEMENTATION NOTES ......................
OVERVIEW............................................................................................................................................ 63 CREATING A MESSAGE ......................................................................................................................... 63 SENDING A MESSAGE ........................................................................................................................... 64 PERMISSIONS ...........................................................
1 Introduction 1 Introduction Purpose This document describes the application program interfaces used to develop Motorola compliant Java™ 2 Platform, Micro Edition (J2ME™) applications for the Motorola C370, C450, and C550 series of handsets. Audience This document is intended for developers involved with the development of J2ME applications for the C370, C450, and C550 series of handsets. Disclaimer Motorola reserves the right to make changes without notice to any products or services described herein.
In no event shall Motorola be liable, whether in contract or tort (including negligence), for any damages resulting form use of a product or service described herein, or for any indirect, incidental, special or consequential damages of any kind, or loss of revenue or profits, loss of business, loss of information or data, or other financial loss arising out of or in connection with the ability or inability to use the Products, to the full extent these damages may be disclaimed by law.
1 Introduction Revision History Version Date Name Reason 0.1 Novemeber 24, 2003 Motocoder Initial Draft 1.0 December 15, 2003 Motocoder Baseline 1.1 December 29, 2003 Motocoder Update Definitions, Abbreviations, Acronyms Acronym Description AMS Application Management Software API Application Program Interface. CLDC Connected Limited Device Configuration FDI Flash Data Integrator. The memory used to store the applications.
MIDP Mobile Information Device Profile OEM Original Equipment Manufacturer OTA Over The Air RMS Record Management System RTOS Real Time Operating System SC Service Center SDK Software Development Kit SMS Short Message Service SU Subscribe Unit UI User Interface URI Location Services Unified Resource Identifier VM Virtual Machine Document Overview This developer’s guide is organized into the following chapters and appendixes: Chapter 1 – Introduction: this chapter has general informat
1 Introduction Chapter 11 – JAD Attributes: this chapter describes what attributes are supported. Chapter 12 – Record Management System: this chapter describes the Record Management System API. Chapter 13 – Phonebook Access: this chapter describes the Phonebook Access API. Chapter 14 – iTAP: this chapter describes iTAP support.
2 J2ME Introduction The C370, C450, and C550 series of handsets 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.
2 J2ME Introduction MIDP-Compliant Apps MIDP OEM Apps Native Apps OEM Classes CLDC Native System Software Mobile Information Device The Configuration Layer used in the C370, C450, and C550 series of handsets is the Connected Limited Device Configuration 1.0 (CLDC 1.0) and the Profile Layer used is the Mobile Information Device Profile 1.0 (MIDP 1.0). Together, the CLDC and MIDP provide common APIs for I/O, simple math functionality, UI, and more.
Resource Description Display Resolution 96 x 64 Color Depth 12 bit color (4096 colors) Networking Max HTTP, UDP and TCP Socket connections* 4 with any combinations File & RMS Max number of Files/RMS* 500 Java VM Heap Size 512 KB Program Space 1.2 MB Max Resource Space* 450 KB Recommended Maximum JAR Size 100 KB *: These resources are shared with the rest of the phone and there could be less available to Java at any given time.
3 Developing and Packaging J2ME Applications 3 Developing and Packaging J2ME Applications Guide to Development in J2ME Introduction to Development This appendix assumes the reader has previous experience in J2ME development and can appreciate the development process for Java MIDlets. This appendix will provide some information that a beginner in development can use to gain an understanding of MIDlets for J2ME series of handsetss.
For beginning development, key points to remember are memory size, processing power, screen capabilities and wireless network characteristics. These all play an important part in development of a MIDlet. The specifications listed above are designed to work upon devices that have these characteristics. Network conditions would only apply for networked applications such as streaming tickers, email clients, etc. In addition to the specifications, an array of tools are available to assist the development cycle.
4 Downloading Applications 4 Downloading Applications OTA Procedure There is no need of additional software tools, or cables, to downloaded MIDlet suites through WAP browser. The application developer just has to use the C370, C450, and C550 browser and connect to a WAP server site that contains the desired MIDlet suite to be downloaded. The application developer should follow the WAP server site instructions to download the MIDlet properly.
• No more than ~500 files are used by installed MIDlet suites. • JAR size listed in JAD matches actual JAR size. • MIDlet suite name and MIDlet vendor are 32 bytes max • MIDlet suite version must be higher than an already installed one. Even though the Data and Program Space in Java System indicate more available space than the size of a particular JAR file, it doesn't necessarily mean the JAR will install.
4 Downloading Applications Program space is used to store class files. Data space is used to store the JAR files before installation and resource files after installation. After installation, the JAR file is destroyed. Then to install the MIDlet Suite, select the “Java Application Loader” option and press the SELECT soft key. A dialogue will be displayed indicating the serial cable is connected to the device. Execute the MIDway tool on PC, select and send the desired MIDlet to be installed.
Launching Web Session for HTTP Download The Web Sessions implementation will be modified to allow the user to download Java content using an HTTP server instead of a WAP gateway. The user will then need to enter a Web Session from the Web Sessions menu. Downloading MIDlets The Browser must be connected before the series of handsets is able to download any MIDlets.
4 Downloading Applications application being downloaded with the version on the series of handsets. One of the following instances will occur: • Same version exists – user is prompted with a dialog stating application already exists and is prompted to cancel or read details of the download. • Older version of application exists – user is prompted with a dialog stating a different version exists and is prompted to update or cancel the download.
vendor="Motorola" version="1.0" date="20010101" adf="DESC.jad" > This is a digital clock running on your series of handsets. An example illustrating a bouncing ball on your screen. PAGE 214 Downloading Applications Example: Taichi handset. New Games This is a directory full of games • The text between the open and close of the tag will be rendered as hyperlink on the page. Example: This is a directory full of games Next page SELECT • The Name attribute of the tag will be rendered as a hyperlink and will be selectable. A space will appear between elements on the page.
5 Application Management MIDlet Lifecycle A MIDlet’s lifecycle begins once its MIDlet Suite is downloaded to the device. From that point, the Application Management Software (AMS) manages the MIDlet Suite and its MIDlets. The user’s primary user interface for the AMS is the Java Apps feature built into the device’s firmware. From the Games & Apps feature, the user can see each MIDlet Suite on the device.
5 Application Management • MIDlet Suite Version • The number of MIDlets in the MIDlet Suite • The Data Space (MIDlet suite resources). • Program Space (Unpacked JAR) Note: This image reflects a 176 x 220 display for document readability purposes only. The C370, C450, and C550 maintain a 96 x 64 display. MIDlet Suite Installation Installation of MIDlet suites can occur from the Java Settings menu or the Browser. A MIDlet Suite must be installed before any of its MIDlets can be executed.
Note: This image reflects a 176 x 220 display for document readability purposes only. The C370, C450, and C550 maintain a 96 x 64 display. Additionally, the items that may appear on the actual device may differ from those displayed in the image above MIDlet Suite De-installation An installed MIDlet can only be removed from the device by de-installing it from the Java Apps menu. De-installing a MIDlet Suite will remove the installed image from Program Space.
5 Application Management MIDlet Suite Updating When a MIDlet Suite is de-installed, all of its resources are removed including any resources that were created by the MIDlets in the suite, such as RMS databases. If a user gets a new version of a MIDlet Suite, then the user can simply download that new version to the device that has the older version installed.
initializing state variables and preparing to be run in its constructor or startApp() methods, it may appear to be stalled to users. The flow below depicts MIDlet State Transitions. Starting Application Constructor startApp() Running Application Paused Application pauseApp() destroyApp() notifyDestroyed() Exit Application The following table shows MIDlet State Transition methods.
5 Application Management AMS, MIDlet pauseApp() The pauseApp() method is called from either AMS or from within the MIDlet. The pauseApp() should pause active threads, and prepare for startApp() to be called. If the application is to be resumed with a screen other than the present, then the Displayable should be set current in the startApp() or the pauseApp(). destroyApp() AMS The destroyApp() method is called from AMS and signals the MIDlet to clean up any resources to prepare for termination.
common error is to implement startApp( ) to execute instructions that are only intended to be executed once during MIDlet execution. The correct implementation is to include in startApp( ) those instructions which can and should be executed each time the MIDlet changes from the Paused state to the Active state. The same logic should be applied to pauseApp( ). The code sample below shows implementation of using startApp( ).
5 Application Management MIDlet Control of MIDlet State Transitions MIDlets have a lot of flexibility to control their own state. A MIDlet can call its own startApp(), pauseApp(), and destroyApp() methods, however those are the methods that the AMS uses to indicate a state transition to the MIDlet. The MIDlet can call those methods if it wishes to perform the work that it would typically do during that state transition.
Note: This image reflects a 176 x 220 display for document readability purposes only. The C370, C450, and C550 maintain a 96 x 64 display.
6 Network API 6 Network API Network Connections The J2ME platform on the Motorola C370, C450, and C550 series of handsets provides a variety of networking functionalities beyond those specified in MIDP. The additional networking protocols are added through the Generic Connection Interface in order to simplify the interface to the application as well as to reduce the need for additional classes.
Class Descriptions <> StreamConnectionNotifier <> DatagramConnection <> Connection <> InputConnection <> OutputConnection <> StreamConnection <> Content Co nnection <> HttpConnection Since all the additional communication protocols have been added to the Generic Connection Framework, the access methods and parameters are very similar.
6 Network API An optional third parameter, protocol may throw an IOException when it detects a time-out condition. - boolean timeout – The time-out period for the TCP implementation on the Motorola C370, C450, and C550 series of handsets is 20 seconds on read operation and about 45 seconds on write operation if the time-out flag is set to true. If the time-out flag is set to false, the time-out time is indefinite.
TCP Sockets The low-level socket used to implement the higher-level HTTP protocol is exposed to applications via the Generic Connection Framework. The usage is similar to the examples above, however, a StreamConnection is returned by the Connection.open() method, as shown in the following example: StreamConnection sc = (StreamConnection)Connector.open( “socket://www.motorola.com:8000”); Although similar to HTTP, notice the required port number at the end of the remote address.
6 Network API Notes It is important to take into consideration the blocking nature of many javax.microedition.io and java.io object methods with regards to networking applications. It is advisable to spawn another thread specifically dedicated to retrieving data in order to keep the user interface interactive. If a single thread is used to retrieve data on a blocking call, the user interface becomes inactive with the end-user perceiving the application as “dead”.
7 LCDUI LCDUI API The following table lists the specific interfaces supported by Motorola implementation: Interface Description Choice Choice defines an API for user interface components implementing selection from a predefined number of choices.
7 LCDUI information of an action. CustomItem A CustemItem is customizable by sub classing to introduce new visual and interactive elements into Forms. DateField A DateField is an editable component for presenting date and time (calendar) information that will be placed into a Form. Display Display represents the manager of the display and input devices of the system. Displayable An object that has the capability of being placed on the display. Font The Font class represents fonts and font metrics.
8 Gaming API and Sound Functional Description The Gaming API provides gaming related functionality to J2ME MIDlet writers. This functionality includes the ability and support for transparent images, the ability to play simple sounds and sound effects during a game, the ability to detect simultaneous key presses, support for sprites, and support for dynamically changing the palette color associated with an image. Class Hierarchy The following diagram shows the Gaming API hierarchy. javax.microedition.
8 Gaming API and Sound BackgroundMusic Class The BackgroundMusic class encapsulates the data for a game's background music. A game may create several BackgroundMusic objects, but only one can be playing at any one time. The sound data can be stored on the device as a named resource in the application JAR file, or it can be stored on a server and retrieved via the network. BackgroundMusic is played by a GameScreen.
GameScreen Class The GameScreen class provides the basis for a game user interface. In addition to the features inherited from MIDP's Canvas (commands, input events, etc.) The GameScreen class provides game-specific capabilities such as an off-screen buffer with synchronized flushing and key status polling. A game can provide its own thread to run the game loop. A typical loop will check for input, implement the game logic, and then render the updated user interface.
8 Gaming API and Sound • public static final int VOLUME_MIN - The minimum volume for playing sound effects. This constant has a value of 0. GameScreen Methods The GameScreen class defines the following methods: • protected Graphics getGraphics() - Obtains the Graphics object for • public int getKeyStates() - Gets the states of the physical keys. Each bit in the returned integer represents a specific key on the device.
information, disabling key events can improve performance. Note that this setting is unique to each GameScreen instance; other GameScreens, when shown, are subject to their own setting for key events. • public void paint(javax.microedition.lcdui.Graphics g) - • public void flushGraphics(int x, int y, int width, int height) – Waits until the end of the current screen refresh cycle and then Paints this GameScreen. By default, this method does nothing. It can be overridden according to application needs.
8 Gaming API and Sound • public void playBackgroundMusic (BackgroundMusic bgm, boolean loop) - Plays the specified BackgroundMusic object from the beginning. This method first stops the current BackgroundMusic if any. Thus, this method may be used to start background music (by specifying a non-null BackgroundMusic object), restart the current background music (by specifying the same BackgroundMusic object), change the background music, or end the background music (by specifying null).
ImageUtil Class ImageUtil provides static methods useful to the manipulation of Image objects. Specifically, it provides methods for setting and getting RGB values, and also provides the ability to create a scaled instance of an existing Image. ImageUtil Fields The ImageUtil class defines the following fields: • public static final int SCALE_AREA - Area scaling method. • public static final int SCALE_REPLICATE - Replicate scaling method. • public static final int SCALE_SMOOTH - Smooth scaling method.
8 Gaming API and Sound 24-bit color format (0xRRGGBB). The method parameters are the following: dest The mutable destination Image whose pixels will be set; x - The horizontal location of left edge of the region; y - The vertical location of the top edge of the region; width - The width of the region; height - The height of the region; and rgbData - The array of RGB pixel values. • public static void setPixels(javax.microedition.lcdui.
} } PalleteImage Class PaletteImage provides methods for manipulating the color palette data of an image. PaletteImages can only be created with palette-based image data (PNG color type 3, or other palette image formats that a particular device may support). A single palette entry or the entire palette can be retrieved as a series of RGB values in 0xRRGGBB format (MIDP color format). The effects of the palette changes will be visible in the next Image that is generated.
8 Gaming API and Sound • public void setTransparentIndex(int index) throws IndexOutOfBoundsException – Sets the current transparent index. Pixels that reference the transparent index in the palette are not drawn when the image is rendered. The effects of the new transparent index will be reflected in the next Image object that is created by calling getImage(). • public int getPaletteSize() - Gets the number of entries in the palette.
raceCar.setPaletteEntry(0, 0x0000FF); Image blueRaceCar = raceCar.getImage(); // Set the car color to green and retrieve the Image raceCar.setPaletteEntry(0, 0x00FF00); Image greenRaceCar = raceCar.getImage(); // The PaletteImage can now be discarded since we have the // Image objects that we need raceCar = null; PlayField Class A PlayField is a rectangular grid of cells with a set of available tiles to place in those cells and a set of associated Sprites.
8 Gaming API and Sound calling setAnimatedTileImage(-2, 2);, cells (0,0) and (0,1) will then be drawn with the image of static Tile 2. Using Sprites In addition to being a grid of cells, a Playfield can have a set of associated Sprites (see 0 item). When the PlayField is drawn, the grid is considered to have depth 0. Therefore, Sprites below the grid (Sprites with Sprite.getDepth() < 0) are drawn first. Then all cells in the grid are drawn. Then all the Sprites above the grid (Sprite.
multiple of the tile width. The height of the source image must be an integer multiple of the tile height. The tiles in the source image will have indices as follows: The static tiles are indexed like words are read on a page; left-to-right, then top-tobottom. The top-left tile is assigned index 1. If there is a tile to its right, this tile is assigned index 2, and so on, across the first row of tiles.
8 Gaming API and Sound PlayField are all empty (tile 0 - a reserved tile and represents an empty square). A tile set can later be added using setStaticTileSet(). PlayField Methods The PlayField class defines the following methods: • public void addSprite(Sprite s) throws NullPointerException – Add a Sprite to the PlayField. Ignores the request if the Sprite is already associated with the PlayField.
source and destination cells overlap, the method shall behave as if the source cells are first copied to a separate array, the source cells are cleared, and the tiles are then copied back to the destination cells.
8 Gaming API and Sound collidesWithAnyTile(Sprite) and collidesWithTiles(int, int, int, int, Sprite, boolean) complement each other. Sprite s does not have to have been added to the PlayField. The collision detection will proceed as if the Sprite is on the PlayField. That is, its location will be treated as relative to the origin of the PlayField's coordinate system. • public boolean collidesWithAnyTile(Sprite s) throws NullPointerException – Check for Sprite collision with PlayField tiles.
• public void setViewWindow(int x, int y, int width, int height) – Sets the portion of the PlayField that will be drawn when draw(Graphics, int, int) is called. This will limit the portion of the PlayField that is drawn to the rectangle defined by the region (x, y) to (x + width, y + height). The default view window (at construction time) is the entire area of the PlayField, i.e. the rectangular region bounded by (0, 0) and (getGridWidth() * getCellWidth(), getGridHeight() * getCellHeight()).
8 Gaming API and Sound SoundEffect Class The SoundEffect class encapsulates the data for a game sound effect. A game may create several SoundEffect objects, one for each of the sounds that it needs to play. The sound data may be stored on the device as a named resource in the application JAR file, or it can be stored on a server and retrieved via the network. SoundEffect instances are played by a GameScreen.
Animation Frames An animated sprite is created from an image divided into sections as described in the constructor Sprite(Image, int, int). The individual sections of the image are considered the raw frames of the Sprite. The method getNumRawFrames returns the number of raw frames. Sprite Drawing Sprites can be drawn at anytime using the draw(Graphics) method. The sprite will be drawn on the Graphics object, according to the current state information maintained by the Sprite (i.e.
8 Gaming API and Sound The creation of the raw frames follows these standards: − Frames must be equally sized, all being of the frame width (fWidth) and height (fHeight) defined in the constructor parameters. They may be laid out in the image horizontally, vertically, or as a grid. The width of the source image must be an integer multiple of the frame width. The height of the source image must be an integer multiple of the frame height.
• public void setDepth(int d) – Set Sprite's depth order. The depth order is relative to other Sprites when multiple Sprites are contained in a container object, i.e. a PlayField. When Sprites are drawn explicitly instead of implicitly through the use of a container object, the management of drawing order is the responsibility of the developer. Integer.MIN_VALUE is the lowest depth, Integer.MAX_VALUE is the highest depth. So items with depth Integer.
8 Gaming API and Sound • public void setVisible(boolean visible) – Set visibility status. If setVisible(false) is called, the Sprite will not be drawn by draw(Graphics) until setVisible(true) is called. • public boolean isVisible() – Get visibility status. The method returns boolean indicating whether the Sprite will be drawn by draw(Graphics). • public final void draw(Graphics g) throws NullPointerException – Draw the Sprite.
− Any custom frame sequence will be deleted and the frame sequence will revert to the default frame sequence for the new frame set (all frames in the frame set, left-to-right then top-to-bottom). Using Sprite The example below creates two Sprites (bullet and tank) and tests collisions between them. When there are no lives left, the game finishes. The following is a code sample to show implementation of using sprites: Sprites try { Sprite bullet = new Sprite(Image.createImage("bullet.
8 Gaming API and Sound FileFormatNotSupportedException Constructors The FileFormatNotSupportedException class defines the following constructors: • public FileFormatNotSupportedException( java.lang.Exception e) – The parameter e is the underlying exception that caused the failure. • public FileFormatNotSupportedException( java.lang.String info) – The parameter info is a String containing information about the failure • public FileFormatNotSupportedException( java.lang.
9 Vibe and Backlight Vibe and Backlight API The Vibe and Backlight API allows J2ME applications access to vibrator, backlight, and keypad control. This access gives a MIDlet the ability to turn on/off these features based on the application’s needs. The MIDlet will use the Vibe and Backlight API to enhance the activity being performed by the application. Examples of these enhancements are the following: • When in a driving game application, the vibrator is turned on during a crash scenario.
10 SMS MO 10 SMS MO Overview 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 – mobile originated) and receive (MT – mobile terminated) SMS (Short Message Service) on the target device.
Sending a Message The SMS MO API will provide an avenue to send a message to the appropriate SMS address. Permissions Prior to the series of handsets sending a SMS message, the series of handsets will check the SMS Access Setting under the Java Settings menu.
11 JAD Attributes 11 JAD Attributes JAD Attributes Motorola has implemented the following support for MIDP 1.
Mandatory attributes for manifest files MIDlet-Name MIDlet-Version MIDlet-Vendor MIDlet- MIDlet-MicroEdition-Profile MIDlet-Install-Notify MIDlet-Delete-Confirm MIDlet-MicroEdition-Configuration MIDlet-Description MIDlet-Icon MIDlet-Info-URL MIDlet-Data-Size MIDlet-Permissions MIDlet-Permissions-Opt MIDlet-Push- MIDlet-Install-Notify MIDlet-Delete-Notify MIDlet-Delete-Confirm
12 Record Management System 12 Record Management System Overview The most common mechanism for persistently storing data on a MIDP device is through RMS. RMS provides the capability to store variable length records on the device. Those records are accessible to any MIDlet in the MIDlet Suite, but not to MIDlets outside of the MIDlet Suite.
//process the IOException } Tips It is much faster to read and write in big chunks than it is to do so in small chunks. Whenever you close a RecordStore, the close command will not return until all the pending writes have been written. A successful call to close a RecordStore guarantees that the data got written. It is then safe to power off the phone; a side effect to this is that the close command may take a while to return.
13 Phonebook Access 13 Phonebook Access Phonebook Access API Using the Phonebook Access API, an application will be able to locate and update contact information on the series of handsets. This contact information includes phone numbers, email addresses, and any other directory information related to individuals, groups, or organizations. The database used to store phonebook information will be unique and integrated for native phonebook, SIM card, and other applications using Phonebook API.
Phonebook Access API Permissions Prior to a MIDlet accessing the Phonebook API for all Phonebook operations, the implementation will check the Phonebook permissions under the Java Settings Menu.
13 Phonebook Access Sample of code for calling of ‘findRecordByName(char firstChar, int sortOrder)’ method: index = PhoneBookRecord.findRecordByName('N', PhoneBookRecord.SORT_BY_NAME); Sample of code for calling of ‘findRecordByEmail(String email, int sortOrder)’ method: String email = “email@mail.com”; index = phbkRec.findRecordByEmail(email, PhoneBookRecord.
int maxNameLengthPhone = PhoneBookRecord.getMaxNameLength(PhoneBookRecord.PHONE_MEMORY); int maxNameLengthSim = PhoneBookRecord.getMaxNameLength(PhoneBookRecord.SIM_MEMORY); int maxNameLengthAll = PhoneBookRecord.getMaxNameLength(PhoneBookRecord.ALL_MEMORY); Sample of code for calling of ‘getMaxTelNoLength (int device)’ method: int maxTelNoLengthPhone = PhoneBookRecord.getMaxTelNoLength(PhoneBookRecord.PHONE_MEMORY); int maxTelNoLengthSim = PhoneBookRecord.getMaxTelNoLength(PhoneBookRecord.
13 Phonebook Access Sample of code for calling of ‘resetPrimary(int index, int sortOrder)’ method: int index = 1; PhoneBookRecord.resetPrimary(index, PhoneBookRecord.SORT_BY_NAME); Sample of code for calling of ‘isPrimary(int speedNo)’ method: int speedNo = 1; boolean res = PhoneBookRecord.
int mlspeedNo = 3, mbspeedNo = 4; PhoneBookRecord.deleteMailingListMember(mlspeedNo, mbspeedNo); Sample of code for calling of ‘getMailingListMembers(int speedNo)’ method: int mlspeedNo = 3; int[] returnArray = PhoneBookRecord.getMailingListMembers(mlspeedNo); Sample of code for calling of ‘isMailingListMember(int mlSpeedNo, int mbSpeedNo)’ method: boolean returnValue = false; int mlspeedNo = 3, mbspeedNo = 4; returnValue = PhoneBookRecord.
13 Phonebook Access int maxCategoryNameLength = PhoneBookRecord.getMaxCategoryNameLength(); Sample of code for calling of ‘getCurrentCategoryView()’ method: int categoryView = PhoneBookRecord.getCurrentCategoryView(); Sample of code for calling of ‘setCategoryView()’ method: int oldCategoryView = PhoneBookRecord.setCategoryView(categoryId); Sample of code to create object of RecentCallDialed class: String name = “Name”; String telNo = “9999999”; int type = RecentCallRecord.
Sample of code for calling of ‘getUsedRecords()’ method: int usedRecs = RecentCallDialed.getUsedRecords(); Sample of code for calling of ‘getNumberRecords()’ method: int numberRecs = RecentCallDialed.getNumberRecords(); Sample of code for calling of ‘getMaxNameLength()’ method: int maxNameLength = RecentCallDialed.getMaxNameLength(); Sample of code for calling of ‘getMaxTelNoLength()’ method: int maxTelNoLength = RecentCallDialed.
13 Phonebook Access Sample of code for calling of ‘getRecord(int index)’ method: int index = 1; receivedRecord.getRecord(1); Sample of code for calling of ‘getUsedRecords()’ method: int usedRecs = RecentCallReceived.getUsedRecords(); Sample of code for calling of ‘getNumberRecords()’ method: int numberRecs = RecentCallReceived.getNumberRecords(); Sample of code for calling of ‘getMaxNameLength()’ method: int maxNameLength = RecentCallReceived.
14 iTAP Intelligent Keypad Text Entry API When users are using features such as SMS (short message service), or “Text Messaging”, they can opt for a predictive text entry method from the series of handsets. The J2ME environment has the ability to use SMS in its API listing. The use of a predictive entry method is a compelling feature to the MIDlet. This API will enable a developer to access iTAP, Numeric, Symbol and Browse text entry methods.
Appendix A: Key Mapping Appendix A: Key Mapping Key Mapping for the C370, C450, and C550 The table below identifies key names and corresponding Java assignments. All other keys are not processed by Java.
CENTER SELECT END SELECT Handled according to VSCL specification: Pause/End/Resume/Background menu invoked.
Appendix B: Memory Management Calculation Appendix B: Memory Management Calculation Available Memory The available memory on the Motorola C370, C450, and C550 series of handsets is the following: • 1M shared memory for MIDlet storage • 512 Kb Heap size • Recommended maximum MIDlet size is 100K 81
Appendix C: FAQ Online 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. http://www.motocoder.
Appendix D: Spec Sheets Appendix D: Spec Sheets C370, C450, and C550 Spec Sheets Listed below are the spec sheets for the Motorola C370, C450, and C550 handsets.
Motorola C370/C450 Developer Reference Sheet Band Frequency Region Technology Connectivity Dimensions Weight Display Operating System Chipset • • • • • • • Color display J2ME™ games (downloadable) Messaging: MMS; EMS 5.0 WAP 2.0 Downloadable themes (ring tones, images, sounds) MIDI ring tones Mini USB connectivity GSM 900/1800 GPRS GSM 850/1900 GPRS Global WAP 2.0, J2ME, SMS, EMS, MMS, AOL/OICQ IM USB 99.5x44x20.6 89 g 96 x 65 Motorola i250S1 CLDC v1.0 and MIDP v2.
Appendix D: Spec Sheets Band Frequency Region Technology Connectivity Dimensions Weight Display Operating System Chipset • • • • • • • • Integrated VGA Camera Color display J2ME™ games (downloadable) Messaging: MMS; EMS 5.0 WAP 2.0 Downloadable themes (ring tones, images, sounds) MIDI ring tones Mini USB connectivity GSM 900/1800 GPRS EMEA/Asia WAP 2.0, J2ME, SMS, EMS, MMS, AOL/OICQ IM USB 99.5x44x20.6 89 g 96 x 65 Motorola i250S1 CLDC v1.0 and MIDP v2.
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. in the U.S. and other countries. © Motorola, Inc. 2002.