Sun Microsystems Computer Accessories manual Device Property Files and the Default Emulator

Page 16

Customization Steps

You customize the J2ME Wireless Toolkit for a new device in three simple steps:

1.Obtain the default J2ME Wireless Toolkit.

The toolkit includes a default development environment and a Default Emulator. The Default Emulator is supplied with sets of device property files that enable the emulation of several generic wireless devices.

2.Create new device property files.

A company that wants to have applications developed for specific devices using the toolkit can modify the device property files and use them with the Default Emulator.

3.Add the new device property files to the J2ME Wireless Toolkit.

The set of device property files that was created for an additional device is copied to the folder in the J2ME Wireless Toolkit's installation that contains device definitions. The new device is automatically added to the device list.

Note – If you need to customize the J2ME Wireless Toolkit in a way that cannot be achieved by producing a new set of device property files alone, please contact Sun Microsystems, Inc. for information about additional possibilities of customizing the J2ME Wireless Toolkit. Send email to wtk-comments@sun.com.

Device Property Files and the Default Emulator

The Default Emulator is the customizable device emulator supplied with the J2ME Wireless Toolkit. It contains the engine used to emulate J2ME applications, along with a highly configurable front end.

The basic definition of a device to be emulated by the Default Emulator is contained in its Main Device Property file. The Main Device Property file covers such features as the size of the screen that is emulated, the locations of image files used to display the device, and the active areas within these images that are used to represent buttons. Other device property files are also used to define a device's characteristics in the Default Emulator; these are mainly image files containing the device's image and images of any on-screen icons that are used in the device's emulation.

A device definition's Main Device Property file is located in the wtklib\devices subdirectory of the J2ME Wireless Toolkit's installation directory. Within the wtklib\devices directory, each emulated device X has a directory X containing a Main Device Property file named X.properties.

2 Wireless Toolkit Basic Customization Guide • December 2003

Image 16
Contents Basic Customization Guide Please Contents Examining Device Property Files Default Emulator Device Property Files Vi Wireless Toolkit Basic Customization Guide December Figures Viii Wireless Toolkit Basic Customization Guide December Tables Wireless Toolkit Basic Customization Guide December Who Should Use This Book How This Book Is OrganizedUsing Operating System Commands Shell Prompts Typographic ConventionsRelated Documentation Accessing Sun Documentation Online Sun Welcomes Your CommentsCustomizing the Wireless Toolkit How to Customize the Wireless ToolkitDevice Property Files and the Default Emulator Customization StepsCustomizing the Wireless Toolkit Wireless Toolkit Basic Customization Guide December Creating Device Property Files Make a Copy of an Existing Main Device Property FileObtain and Enter Image Files Obtain and Enter the Screen Properties Screen LocationTotal Screen Size Display AreaDisplay Area in Full Screen Mode Specifying Screen PropertiesObtain and Enter the Button Properties By measuring the image file, obtain the button propertiesHeight Width Obtain and Enter Soft Button Label Areas Soft button label display is defined by a line of the form Obtain and Enter Icon Properties Defining the Icon Location and StatesEnter the following measured values for the icons properties Run the Emulator for the New Device Enter Color PropertiesScreen Background RGB Color Examining Device Property Files Device Property Files Fonts Main Device Property FileFonts Used by the Midp APIs System Fonts Default FontBitmap Fonts Ascii character Distance to character Font Underlining Device ImageImage without Buttons Pressed Image with Buttons PressedImage with Buttons Highlighted and Backlight On ScalingScreen Properties Screen Location Total Screen Size Display Area in Full Screen ModeDisplay Area Screen Pixel Ratio Screen Background ColorTouch Screen Screen Border ColorScreen Buffering Keyboard Handler Device ButtonsDefining a Device Button Button.LEFT = 13, 197, 20 Assigning a PC Keyboard Key to a Button Assigning a Game Action to a Button Specifying the Characters Generated by a Button PressAssigning Abstract Commands to Buttons Abstract Command Types in Order of PrecedenceEmulating Abstract Command Button Assignments Precedence of Assigning Commands to a Button Secondary Button Assignments Abstract Command Menu Displayed Icons Defining the Icon Location and StatesSoft Button Label Display Soft Button Labels on the Emulated Device DisplayColor Sound AlertsDevice Software Capabilities Alert Type ValuesLocales Character EncodingsEnableAlphaChannel false Transparent ImagesWireless Toolkit Basic Customization Guide December Default Emulator Device Property Files Property FilesDefaultGrayPhone.properties Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December # alert.alerttype.sound soundfile Wireless Toolkit Basic Customization Guide December Device Image Files Icon Image FilesIcon Image Files Support for ByteCode Obfuscators Adding a ByteCode ObfuscatorExample Appendix B Support for ByteCode Obfuscators Wireless Toolkit Basic Customization Guide December P E N D I X C Wireless Toolkit Basic Customization Guide December Index Keyboard.handler property Device property files, 1 WMA messages, customizing Wireless Toolkit Basic Customization Guide December