Sun Microsystems Computer Accessories manual Creating Device Property Files

Page 19

C H A P T E R 2

Creating Device Property Files

This chapter presents a simple tutorial that walks you through the procedures for creating a device property file. You will learn how to use the new device property files to enable the J2ME Wireless Toolkit to emulate applications for the device. See Chapter 3, “Examining Device Property Files” for a detailed reference on device properties, the custom-tailoring options available, and how to use them.

In the following step-by-step tutorial, you will create a device definition for a device called NewPhone. Because of the similarity of NewPhone to the DefaultColorPhone device included with the J2ME Wireless Toolkit, the tutorial adapts the existing property file for DefaultColorPhone.

The steps of the tutorial are:

Make a Copy of an Existing Main Device Property File

Obtain and Enter Image Files

Obtain and Enter the Screen Properties

Obtain and Enter the Button Properties

Obtain and Enter Soft Button Label Areas

Obtain and Enter Icon Properties

Enter Color Properties

Run the Emulator for the New Device

Make a Copy of an Existing Main Device Property File

You will create a device property file for a new emulated device called NewPhone.

The first step in creating a property file for NewPhone is to copy the directory associated with the existing device, DefaultColorPhone, to the new directory NewPhone and to rename the main property file.

5

Image 19
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 How This Book Is Organized Who Should Use This BookUsing Operating System Commands Shell Prompts Typographic ConventionsRelated Documentation Sun Welcomes Your Comments Accessing Sun Documentation OnlineHow to Customize the Wireless Toolkit Customizing the Wireless ToolkitCustomization Steps Device Property Files and the Default EmulatorCustomizing the Wireless Toolkit Wireless Toolkit Basic Customization Guide December Make a Copy of an Existing Main Device Property File Creating Device Property FilesObtain and Enter Image Files Screen Location Obtain and Enter the Screen PropertiesDisplay Area Total Screen SizeSpecifying Screen Properties Display Area in Full Screen ModeBy measuring the image file, obtain the button properties Obtain and Enter the Button PropertiesHeight Width Obtain and Enter Soft Button Label Areas Soft button label display is defined by a line of the form Defining the Icon Location and States Obtain and Enter Icon PropertiesEnter 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 Device Image Font UnderliningScaling Image without Buttons PressedImage with Buttons Pressed Image with Buttons Highlighted and Backlight OnScreen Properties Screen Location Total Screen Size Display Area in Full Screen ModeDisplay Area Screen Background Color Screen Pixel RatioTouch 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 Specifying the Characters Generated by a Button Press Assigning a Game Action to a ButtonAbstract Command Types in Order of Precedence Assigning Abstract Commands to ButtonsEmulating Abstract Command Button Assignments Precedence of Assigning Commands to a Button Secondary Button Assignments Abstract Command Menu Defining the Icon Location and States Displayed IconsSoft Button Labels on the Emulated Device Display Soft Button Label DisplaySound Alerts ColorAlert Type Values Device Software CapabilitiesCharacter Encodings LocalesTransparent Images EnableAlphaChannel falseWireless Toolkit Basic Customization Guide December Property Files Default Emulator Device 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 Icon Image Files Device Image FilesIcon Image Files Adding a ByteCode Obfuscator Support for ByteCode ObfuscatorsExample 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