Preprocessorsto

字节跳动回应TikTok易主  时间:2021-02-05  阅读:()
AppendixThisappendixisaquickreferenceguideforyoutoeasilyfindinformationonsettings,attributes,anddirectives.
PART4AppendixJADandManifestAttributesMIDP1.
0AttributesTableA-1listsallMIDP1.
0attributesandshowshowtosetthemusingJ2MEPolish.
Whenapreprocessingvariablewiththespecifiednameisdefined,itwilloverridethesettingsmadeinthesection.
353TableA-1.
DefiningMIDP1.
0AttributesinJ2MEPolishAttributeAttributePreprocessingVariableDescriptionMicroEdition-ConfigurationconfigurationTheJ2MEconfigurationthatisusedbytheMIDlet,eitherCLDC-1.
0orCLDC-1.
1.
YoucannotinstallaCLDC1.
1applicationonaCLDC1.
0device.
Theconfigurationissetautomatically;usetheconfigurationattributeforoverridingthissetting.
MicroEdition-ProfileprofileTheJ2MEprofilethatisusedbytheMIDlet,eitherMIDP1.
0,MIDP2.
0,orMIDP3.
0.
YoucannotinstallaMIDP2.
0applicationonaMIDP1.
0device.
Theprofileissetautomatically;usetheprofileattributeforoverridingthissetting.
MIDlet-TheMIDletclassesintheJARfile,thefirstofwhichisdefinedbytheMIDlet-1attribute.
YoucansetyourMIDletclasseswiththeelementofthesection.
ContinuedTableA-1.
ContinuedAttributeAttributePreprocessingVariableDescriptionMIDlet-Data-SizedataSizeTheneededspaceinbytesonthedeviceforadditionaldata.
Whentheavailablespaceisnotsufficient,theMIDletwillnotbeinstalled.
MIDlet-Descriptiondescription${MIDlet-Description}AdescriptionoftheMIDletsuite.
MIDlet-Iconicon${MIDlet-Icon}ThePNGimageusedasanicon.
MIDlet-Info-URLinfoUrl${MIDlet-Info-URL}AURLthatprovidesadditionalinformationabouttheapplication.
MIDlet-Jar-SizeThesizeofthefinalJARfilesizeinbytes.
MIDlet-Jar-URLjarUrlTheURLthatprovidestheJARfileforthisJADfile.
MIDlet-Namename${MIDlet-Name}ThenameoftheMIDletsuite.
MIDlet-VendorvendorName${MIDlet-Vendor}Thenameoftheapplicationvendor.
MIDlet-Versionversion${MIDlet-Version}TheversionoftheMIDletsuite.
APPENDIX354TheattributesMIDlet-Jar-Size,MIDlet-,MicroEdition-Profile,andMicroEdition-ConfigurationaresetautomaticallybyJ2MEPolish.
Youcan,however,overridetheconfigurationandprofilesettingswiththeXMLattributesconfigurationandprofileoftheelement.
Thiscanbeusefulwhenyouloadclassesdynamicallyforexploitingdevice-specificfunctionalityinyourapplication.
MIDP2.
0AttributesTheMIDP2.
0platformintroducesthenewattributeslistedinTableA-2.
TableA-2.
DefiningMIDP2.
0AttributesinJ2MEPolishAttributeAttributePreprocessingVariableDescriptionMIDlet-Certificate-1-1ThecertificateusedforcalculatingtheSHA1hashvalue.
MIDlet-Delete-ConfirmdeleteConfirm${MIDlet-Delete-Confirm}Amessagethatalertstheuserwhentheapplicationisremoved.
Vendor-SpecificAttributesSomevendorsandcarrierssupportadditionalattributes,asshowninTableA-3.
Theseattrib-utesarecreatedinthesamewayasuser-definedattributes;thatis,youneedtousetheelementsintheelementfordefiningtheseattributes.
TableA-3.
Vendor-andCarrier-SpecificAttributesVendorAttributeDescriptionLGElectronicsMIDletX-No-CommandThisattributecandeactivatethecommandbarwhenitissettotrue.
LGElectronicsMIDletX-Big-IconThebig(3232)iconfortheapplication.
LGElectronicsMIDletX-Medium-IconThemedium(1818)iconfortheapplication.
MotorolaBackgroundMIDletsinwhichBackgroundisTrue(casesensitive)willbeabletoruninthebackgroundaswell(e.
g.
,whenanincomingcallblockstheapplication).
MotorolaFlipInsensitiveWhenFlipInsensitiveisTrue(casesensitive),theapplicationcontinuestorunevenwhentheflipisclosed.
Inthiscase,audioresourcesarestillavailabletotheapplication.
MotorolaMot-Data-Space-RequirementTheneededsizeinkilobytes(roundedup)fortheapplication.
ThisattributeisvalidfortheV60iandV66idevicesonly.
ContinuedAPPENDIX355AttributeAttributePreprocessingVariableDescriptionMIDlet-Delete-NotifydeleteNotify${MIDlet-Delete-Notify}AURLthatiscalledwhentheapplicationisremoved.
TheusercansuppressthecallingofthisURL.
MIDlet-Install-NotifyinstallNotify${MIDlet-Install-Notify}AURLthatiscalledwhentheapplicationisinstalled.
TheusercansuppressthecallingofthisURL.
MIDlet-Jar-RSA-SHA1TheSHA1hashvalueoftheJARfile.
MIDlet-Permissionspermissions${MIDlet-Permissions}ThepermissionsrequiredbytheMIDletforittoworkcorrectly(e.
g.
,javax.
microedition.
io.
Connector.
http).
MIDlet-Permissions-OptoptionalPermissions${MIDlet-Permissions-Opt}Thepermissionsthatareusefulforthisapplicationtowork.
TableA-3.
ContinuedVendorAttributeDescriptionMotorolaMot-Data-Space-RequirementsTheneededsizeinkilobytes(roundedup)fortheapplicationonaT720,C370,C450,orC550device.
MotorolaMot-Program-Space-RequirementTheneededsizeinkilobytes(roundedup)fortheapplicationbundleitself(liketheMIDlet-Jar-Sizeattribute).
Ifthisisnotspecified,16KBisthemaximumsizeoftheRMS.
ThisattributeisvalidfortheV60iandV66idevicesonly.
MotorolaMot-Program-Space-RequirementsTheneededsizeinkilobytes(roundedup)fortheapplicationbundleitself(liketheMIDlet-Jar-Sizeattribute)onaT720,C370,C450,orC550device.
Ifthisattributeisnotspecified,16KBisthemaximumsizeoftheRMS.
MotorolaMIDlet-Data-SizeEventhoughthisisnotaMotorola-specificproperty,youshouldspecifyMIDlet-Data-SizeinbyteswhenyourRMSneedsmorethan16KB.
Nokia,Series40Nokia-MIDlet-CategoryThesectionontheSeries40mobilephoneintowhichtheapplicationshouldbeinstalled(e.
g.
,Game).
ThisisaJAD-onlyattribute.
VodafoneMIDxlet-APITheVodafoneAPIthatshouldbeused(e.
g.
,VSCL-1.
0.
1orVSCL-1.
1.
0).
VodafoneMIDxlet-NetworkThisattributedefineswhethernetworkaccessisneededforthisMIDlet.
PossiblevaluesareYandN.
VodafoneMIDxlet-ResidentYoucanmakeyourapplicationmemoryresident,sothatitrunsinthebackground.
Itthencouldactasascreensaverorreceiveeventssuchasincomingmessages.
PossiblevaluesareYandN.
VodafoneMIDxlet-Application-ResolutionTheresolutionoftheapplication(e.
g.
,120-240,130-320).
RuntimePropertiesYoucanuseruntimepropertiesfordeterminingthecapabilitiesofthedeviceaswellassomeuserpreferencesduringruntime.
SystemPropertiesYoucanquerysystempropertieswiththeSystem.
getProperty(String)method.
Thedevicedatabasewillalsolistthesepropertiesinfutureversions.
Inthatcase,youcancheckforspe-cificsystempropertieswiththepolish.
Property.
[property-name]preprocessingvariableAPPENDIX356(e.
g.
,//#ifpolish.
Property.
microedition.
jtwi.
version:defined).
YoucancheckmanypropertieswiththeSysInfoMIDletin${polish.
home}/samples/sysinfo.
TableA-4listscommonsystemattributes.
CautionNeverassumethatasystempropertyisdefined—alwayscheckwhetheritisnull.
TableA-4.
SystemPropertiesLibraryPropertyExampleValueExplanationLocationmicroedition.
location.
version1.
0DetermineswhethertheLocationAPI(JSR179)issupportedM3Gmicroedition.
m3g.
version1.
0TheversionofthesupportedMobile3DGraphicsAPI(JSR184)MIDPmicroedition.
configurationCLDC-1.
0ThesupportedconfigurationofthedeviceMIDPmicroedition.
encodingISO8859-1ThedefaultcharacterencodingofthedeviceMIDPmicroedition.
localeen-UKThepreferredlocaleoftheuserMIDPmicroedition.
platformSonyEricssonK700i/ThenameandversionR2A041ofthedeviceMIDPmicroedition.
profilesMIDP-1.
0MIDP-2.
0Thesupportedprofile(s)ofthedeviceJTWImicroedition.
jtwi.
version1.
0TheversionofthesupportedJTWIversion(JSR185),ifsupportedMMAPIaudio.
encodingrate=16000&bits=32ParametersforrecordingaudioMMAPImicroedition.
media.
version1.
1TheversionofthesupportedMultimediaAPI,ifsupportedMMAPIsupports.
mixingtrueIstruewhenthedevicecanplayseveralsoundssimultaneouslyMMAPIsupports.
audio.
capturetrueIstruewhenthedevicecanrecordaudioMMAPIsupports.
recordingfalseIstruewhenthedevicecanrecordmediaMMAPIsupports.
video.
capturetrueIstruewhenthedevicecantakepicturesorvideosequencesMMAPIstreamable.
contentsnullAnyformatsthatcanbestreamedContinuedAPPENDIX357TableA-4.
ContinuedLibraryPropertyExampleValueExplanationMMAPIvideo.
encodingsencoding=JPEG&Parametersforrecordingwidth=176&videoortakingsnapshotsheight=182MMAPIvideo.
snapshot.
encodingencoding=JPEGSupportedimageformatsfortakingsnapshotsPDAAPImicroedition.
io.
file.
1.
0TheversionoftheFileConnection.
versionsupportedFileConnectionAPI(JSR75)PDAAPImicroedition.
pim.
version1.
0TheversionofthesupportedPIM-API(JSR75)Sensormicroedition.
sensor.
version1.
0TheversionoftheSensorAPI(JSR256),ifsupportedWMAPIwireless.
messaging.
sms.
smsc+4912345678ThenumberoftheusedShortMessageServiceCenter(JSR120)BluetoothPropertiesPropertiesoftheBluetoothAPI(JSR82),listedinTableA-5,cannotbeacquiredbycallingSystem.
getProperty();theycanbeacquiredonlybyinvokingLocaleDevice.
getProperty().
Otherthanthat,theybehavejustlikesystemproperties,soyoushouldalwayscheckreturnedvaluesagainstnull.
TableA-5.
BluetoothPropertiesPropertyExampleValueExplanationbluetooth.
api.
version1.
0TheversionoftheJavaAPIsforBluetoothwirelesstechnologythatissupportedbluetooth.
connected.
devices.
max1Themaximumnumberofconnecteddevices,includingparkeddevicesbluetooth.
connected.
inquiryfalseDefineswhetheraninquiryisallowedwhileaconnectionisestablishedbluetooth.
connected.
inquiry.
scanfalseDefineswhetherinquiryscanningisallowedduringaconnectionbluetooth.
connected.
pagefalseDefineswhetherpagingisallowedduringaconnectionbluetooth.
connected.
page.
scanfalseDefineswhetherpagescanningisallowedduringaconnectionAPPENDIX358PropertyExampleValueExplanationbluetooth.
l2cap.
receiveMTU.
max512ThebufferforreceivingMTUinL2CAPbluetooth.
master.
switchfalseDefineswhetherthemaster/servantrolescanbeswitchedduringaconnectionbluetooth.
sd.
attr.
retrievable.
max1Themaximumnumberofserviceattributestoberetrievedperservicerecordbluetooth.
sd.
trans.
max1Themaximumnumberofserviceattributestoberetrievedperservicerecord3DPropertiesTheMobile3DGraphicsAPI(JSR184)definesitsownproperties(seeTableA-6)thatcannotberetrievedoverthenormalSystem.
getProperty()mechanism.
Instead,aHashtablecontain-ingthepropertiescanberetrievedbycallingGraphics3D.
getProperties().
Contrarytootherpropertyfunctions,thestoredvaluesarenotStrings,butIntegersorBooleans.
TableA-6.
3DPropertiesMinimumPropertyTypeValueExplanationmaxLightsInteger8Themaximumnumberofconcurrentlights.
maxSpriteCropDimensionInteger256ThemaximumsizeoftheactualdisplayedareaofaSprite3D.
maxTextureDimensionInteger256Themaximumsize(widthorheight)ofaTexture2D.
maxTransformsPerVertexInteger2ThemaximumnumberoftransformationsfortheverticesofaSkinnedMesh.
maxViewportDimensionInteger256ThemaximumallowedwidthandheightoftheGraphics3D'sviewport.
numTextureUnitsInteger1ThemaximumnumberoftexturesforanAppearance.
supportAntialiasingBooleanfalseAllowstheuseofantialiasingtoincreasetheperceivedresolutionofthescreen.
supportDitheringBooleanfalseAllowstheuseofditheringtoincreasetheperceivedcolordepthofthescreen.
ContinuedAPPENDIX359TableA-6.
ContinuedMinimumPropertyTypeValueExplanationsupportLocalCameraLightingBooleanfalseIflocalcameralightingisdisabled,thedirectionvectorfromthecameratothevertexbeinglitisapproximatedwith(00-1).
Iflocalcameralightingisenabled,thedirectioniscomputedbasedonthetruecameraposition.
supportMipmappingBooleanfalseDefineswhetheryoucanfiltertexturesbetweenorwithinmipmaplevels.
supportPerspectiveCorrectionBooleanfalseAllowscorrectionofperspectivesinpolygons.
Thelackofperspectivecorrectionisespeciallyevidentonlarge,texturedpolygons;thetextureisdistortedandseemsto"crawl"onthesurfaceastheviewinganglechanges.
supportTrueColorBooleanfalseAllowsrenderingwithaninternalcolordepthhigherthanwhatissupportedbythedevice.
Thisisusefulincombinationwithdithering.
PermissionsforSignedMIDletsTheMIDP2.
0standardallowssignedMIDletstorequestpermissionsforcertainactionsdur-ingtheinstallation.
Inthatcase,theuserwon'tbebotheredbyscreensaskinghimtopermitnetworkconnectionsandsoforthwhenevertheapplicationaccessesasecurity-sensitiveresource.
YoucansetpermissionswiththepermissionsandoptionalPermissionsattributesofthesectioninyourbuild.
xmlscript.
TableA-7containscommonpermissionsforavarietyofprotocolsandoptionalAPIs.
TableA-7.
MIDP2.
0SecurityPermissionsEntityPermissionExplanationHTTPjavax.
microedition.
io.
Connector.
httpForestablishingHTTPconnectionsHTTPSjavax.
microedition.
io.
Connector.
httpsForestablishingsecureHTTPconnectionsUDPjavax.
microedition.
io.
Connector.
datagramForsendingUPDdatagramsAPPENDIX360EntityPermissionExplanationUDPjavax.
microedition.
io.
Connector.
datagramreceiverForreceivingUPDdatagramsTCPjavax.
microedition.
io.
Connector.
socketForestablishingoutboundTCPconnectionsTCPjavax.
microedition.
io.
Connector.
serversocketForacceptinginboundTCPconnectionsSSLjavax.
microedition.
io.
Connector.
sslForconnectingviaSSLorTLSSerialjavax.
microedition.
io.
Connector.
commForestablishingserialconnections(e.
g.
,overtheinfraredport)Pushjavax.
microedition.
io.
PushRegistryForsettingalarmsorRegistryregisteringinboundconnectionsSMSjavax.
microedition.
io.
Connector.
smsForopeningaSMSconnectionintheWMAPISMSjavax.
microedition.
io.
Connector.
sms.
sendForsendingashortmessageintheWMAPISMSjavax.
microedition.
io.
Connector.
sms.
receiveForreceivingashortmessageintheWMAPICBSjavax.
microedition.
io.
Connector.
cbsForopeningacellbroadcastconnectionintheWMAPICBSjavax.
microedition.
io.
Connector.
cbs.
receiveForreceivingacellbroadcastintheWMAPIMMSjavax.
microedition.
io.
Connector.
mmsForopeningaMMSconnectionintheWMAPI2.
0MMSjavax.
microedition.
io.
Connector.
mms.
sendForsendingamultimediamessageintheWMAPI2.
0MMSjavax.
microedition.
io.
Connector.
mms.
receiveForreceivingamultimediamessageintheWMAPI2.
0Bluetoothjavax.
microedition.
io.
Connector.
bluetooth.
serverForopeningaBluetoothserverconnectionintheBTAPI(e.
g.
,Connector.
open("btspp://localhost:.
.
.
"))ContinuedAPPENDIX361TableA-7.
ContinuedEntityPermissionExplanationBluetoothjavax.
microedition.
io.
Connector.
bluetooth.
clientForopeningaclientBluetoothconnectionintheBTAPI(e.
g.
,Connector.
open("btspp:PIMjavax.
microedition.
pim.
ContactList.
readForreadingacontactlistinthePIMAPIPIMjavax.
microedition.
pim.
ContactList.
writeForwritingintoacontactlistinthePIMAPIPIMjavax.
microedition.
pim.
EventList.
readForreadinganeventlistinthePIMAPIPIMjavax.
microedition.
pim.
EventList.
writeForwritingtoaneventlistinthePIMAPIPIMjavax.
microedition.
pim.
ToDoList.
readForreadingato-dolistinthePIMAPIPIMjavax.
microedition.
pim.
ToDoList.
writeForwritingintoato-dolistinthePIMAPIFilejavax.
microedition.
io.
Connector.
file.
readForreadingafileintheFileConnectionAPIFilejavax.
microedition.
io.
Connector.
file.
writeForwritingafileintheFileConnectionAPILocationjavax.
microedition.
location.
LocationForgettingthelocationintheLocationAPILocationjavax.
microedition.
location.
OrientationForgettingtheorientationofthedeviceintheLocationAPILocationjavax.
microedition.
location.
ProximityListenerForaddingaproximitylistenerintheLocationAPILocationjavax.
microedition.
location.
LandmarkStore.
readForreadinglandmarksintheLocationAPILocationjavax.
microedition.
location.
LandmarkStore.
writeForsettinglandmarksintheLocationAPILocationjavax.
microedition.
location.
LandmarkStore.
categoryFororganizinglandmarksintheLocationAPILocationjavax.
microedition.
location.
LandmarkStore.
managementFormanagingland-marksintheLocationAPIAPPENDIX362TheJ2MEPolishAntSettingsJ2MEPolishsupportsawiderangeofelementsandattributesthatyoucanuseinyourbuild.
xmlscripts.
SectionInthesection,generalinformationabouttheprojectisdefined(seeTableA-8).
TheinformationgiveninthesectiondefinestheJADandManifestattributesindi-rectly.
Ifyouneedtosetattributesthatarenotsupportedbythesection,youcanusetheelementinthesection.
TableA-8.
AttributesoftheSectionAttributeRequiredExplanationconfigurationNoNormally,J2MEPolishusestheJavaConfigurationcapabilityofthecurrenttargetdevicefordeterminingthecorrectMicroEdition-Configurationsetting.
Youcanoverridethisbyhard-codingtheconfigurationforalltargetdevices.
Thisisusefulonlyincaseswhenyoudeterminedevicecapabilitiesduringtheruntimeoftheapplicationandwanttodeliveroneapplicationbundleforalltargetdevices.
copyrightNoThecopyrightnotice.
dataSizeNoTheminimumspaceneededonthedevice(e.
g.
,dataSize="120kb").
ThevariableMIDlet-Data-Sizeoverridesthissetting.
deleteConfirmNoThetextpresentedtotheuserwhenshetriestodeletetheapplication.
ThevariableMIDlet-Delete-Confirmoverridesthissetting;thiscanbeusedtolocalizetheapplication.
deleteNotifyNoAnHTTPURLthatshouldbecalledaftertheapplicationhasbeendeletedfromthedevice.
SeetheexplanationofinstallNotify.
ThevariableMIDlet-Delete-Notifyoverridesthissetting.
descriptionNoThedescriptionoftheproject.
Abriefexplanationaboutwhatthisapplicationdoesshouldbegivenhere.
ThevariableMIDlet-Descriptionoverridesthevaluegivenhere;thiscanbeusedtolocalizetheapplication.
infoUrlNoTheURLthatcontainsmoreinformationabouttheapplication.
ThevariableMIDlet-Info-URLoverridesthissetting;thiscanbeusedtolocalizetheapplication.
installNotifyNoAnHTTPURLthatshouldbecalledafterthesuccessfulinstallationoftheapplication.
Thiscanbeusefulfortrackinghowmanyapplicationsareinstalled.
Theusercanpreventtheinstall-notify,though.
YoucanusethesamevariablesasforthejarUrlattribute.
ThevariableMIDlet-Install-Notifyoverridesthissetting.
ContinuedAPPENDIX363TableA-8.
ContinuedAttributeRequiredExplanationjarNameYesThenameoftheJARfilesthatwillbecreated.
ApartfromtheusualJ2MEPolishvariables,thefollowingvariablesareespeciallyuseful:${polish.
vendor}:Thevendorofthedevice(e.
g.
,Samsung,Motorola,etc.
)${polish.
name}:Thenameofthedevice${polish.
version}:Theversionoftheprojectasdefinedpreviously${polish.
locale}:Thecurrentlocale(e.
g.
,en,de_DE,etc.
)Forexample,jarName="Game-${nospace(polish.
vendor)}-${nospace(polish.
name)}-${polish.
locale}.
jar"translatesintoGame-Nokia-6600-en.
jarforanapplicationthathasbeenoptimizedfortheNokia6600andusestheEnglishlocale.
Usethenospacepropertyfunctiontoremoveallspacesfromthevariablevalues.
Definethepolish.
jarNamepreprocessingvariableforoverridingthissetting.
jarUrlNoTheURLfromwhichtheJARfilecanbedownloaded.
ThisiseithertheHTTPaddressorjustthenameoftheJARfilewhenitisloadedlocally.
WhennojarUrlisdefined,thejarNamedefinedpreviouslyisused.
ApartfromthevariablesavailableforthejarNameattribute,youcanusethenameoftheJARfileasdefinedpreviously:jarUrl="http://www.
enough.
de/midlets/Game/${polish.
vendor}/${polish.
name}/${polish.
jarName}"licenseYesThelicenseunderwhichJ2MEPolishisused,eitherGPLorthecommerciallicensekey.
nameYesThenameoftheproject.
ThevariableMIDlet-Nameoverridesthissetting.
Usethisvariabletolocalizetheapplication.
optionalPermissionsNoThepermissionsthatareusefulforthisapplicationtowork.
ThevariableMIDlet-Permissions-Optoverridesthissetting.
permissionsNoThepermissionsneededbythisapplication(e.
g.
,javax.
microedition.
io.
Connector.
http).
ThevariableMIDlet-Permissionsoverridesthissetting.
profileNoNormally,J2MEPolishusestheJavaPlatformcapabilityofthecurrenttargetdevicefordeterminingthecorrectMicroEdition-Profilesetting.
Youcanoverridethisbyhard-codingtheprofileforalltargetdevices.
Thisisusefulonlyincaseswhenyoudeterminedevicecapabilitiesduringtheruntimeoftheapplicationandwanttodeliveroneapplicationbundleforalltargetdevices.
vendorNameYesThenameofthevendorofthisapplication.
ThevariableMIDlet-Vendoroverridesthissetting.
versionYesTheversionoftheprojectintheformat[major].
[minor].
[build](e.
g.
,version="2.
1.
10").
ThevariableMIDlet-Versionoverridesthissetting.
APPENDIX364DeviceRequirementsSectionTheoptionalsectionisresponsibleforselectingthedevicesthataresupportedbytheapplication.
Whenthissectionisomitted,theapplicationwillbeoptimizedforallknowndevices(therearemorethan300devices).
TableA-9presentstheattributesandTableA-10presentsthenestedelementsofthesection,andTableA-11presentstheattributesoftheelements.
TableA-9.
AttributesoftheSectionAttributeRequiredExplanationifNoThenameoftheAntpropertythatneedstobetrueoryestousethisunlessNoThenameoftheAntpropertythatneedstobefalseornotousethisTableA-10.
NestedElementsoftheSectionElementRequiredExplanationYesTherequirementthatneedstobefulfilledbythedeviceNoAseriesofrequirements,allofwhichneedtobefulfilledNoAseriesofrequirements,atleastoneofwhichneedstobefulfilledNoAseriesofrequirements,oneofwhichneedstobefulfilledNoAseriesofrequirements,noneofwhichmustbefulfilledTableA-11.
AttributesofElementAttributeRequiredExplanationnameYesThenameoftheneededcapability(e.
g.
BitsPerPixel).
valueYesTheneededvalueofthecapability(e.
g.
,16+foracolordepthofatleast16bitsperpixel).
typeNoTheclassthatcontrolsthisrequirement.
Theclassmusteitherextendthede.
enough.
polish.
ant.
requirements.
Requirementclass,oroneofthebasetypesSize,Int,String,Version,orMemory(e.
g.
,).
APPENDIX365BuildSectionWiththesection,theactualbuildprocessiscontrolled.
Theelementsupportsmanyattributesandnestedelements,asshowninTableA-12.
TableA-12.
AttributesoftheSectionAttributeRequiredExplanationapiDirNoThefolderinwhichtheAPIsarestored.
Itdefaultsto${polish.
home}/import.
apisNoThepathtotheapis.
xmlfile.
Itdefaultstoapis.
xmlintheproject'sfolderorin${polish.
home}.
binaryLibrariesorbinaryLibraryNoEitherthenameofthedirectorythatcontainsbinary-onlylibrariesorthename(s)ofthelibraries.
Severallibrariescanbeseparatedbycolons(:)orbysemicolons(;).
Whennopathisdefined,thelibrarieswillbesearchedwithintheimportfolderbydefault.
Thismechanismcanbeusedonlyforthird-partyAPIs,whicharenotavailableonthephoneitself.
DeviceAPIsareautomaticallyincluded,aftertheyhavebeendefinedinthe${j2mepolish.
home}/apis.
xmlfile.
Alternatively,youcanalsousethenestedelement,whichallowsyoufine-grainedcontrol.
devicesNoThepathtothedevices.
xmlfile.
Itdefaultstodevices.
xmlintheproject'sfolderorin${polish.
home}.
compilerDestDirNoDefineswherethecompiled(andobfuscated)classesshouldbestoredwhenthecompilermodeisactivated.
Thedefaulttargetdirectoryisbin/classes.
compilerModeNoWhenthecompilermodeisactivated,J2MEPolishwillnotpackagetheapplicationandwillprocessonlyonedevice.
ThismodeisusefulforIDEsthatsupportindirectcompilationsuchasNetBeans.
YoucanselectRuninNetBeans,andNetBeanswilluseJ2MEPolishascompiler,packagetheapplication,andstarttheemulator—thissavesvaluabletimeduringthedevelopmentphase.
YoucanalsousethisfeaturetointegrateJ2MEPolishwiththeEclipseMEplug-in.
Inthatcase,youalsoneedtosetthecompilerDestDirtopreverifiedandenablethecompilerModePreverifyoption(bothattributesaredescribedshortly).
Possiblevaluesaretrueorfalse.
Thecompilermodeisdeactivated(false)bydefault.
APPENDIX366AttributeRequiredExplanationcompilerModePreverifyNoDefineswhetherJ2MEPolishshouldpreverifythecompiledclassesaswell.
ThisisneededforusingJ2MEPolishasacompilerfortheEclipseMEplug-in.
Possiblevaluesaretrueorfalse.
Thepreverifyingisdeactivated(false)bydefault.
customApisNoThepathtothecustom-apis.
xmlfile.
Itdefaultstocustom-apis.
xmlintheproject'sfolderorin${polish.
home}.
customDevicesNoThepathtothecustom-devices.
xmlfile.
Itdefaultstocustom-devices.
xmlintheproject'sfolderorin${polish.
home}.
customGroupsNoThepathtothecustom-groups.
xmlfile.
Itdefaultstocustom-groups.
xmlintheproject'sfolderorin${polish.
home}.
customVendorsNoThepathtothecustom-vendors.
xmlfile.
Itdefaultstocustom-vendors.
xmlintheproject'sfolderorin${polish.
home}.
destDirNoThefolderintowhichthe"readytodeploy"applicationbundlesshouldbestored.
Itdefaultstothedistfolder.
encodingNoTheencodingforthegeneratedJADandManifestfiles.
ItdefaultstoUTF8.
full-screenNoDefineswhetherthecompletescreenshouldbeusedfordevicesthatsupportafullscreenmode.
CurrentlytheseincludemostMIDP2.
0devicesaswellasdevicesthatsupporttheNokiaUIAPI.
Possiblevaluesareno,yes,andmenu.
Whenthevalueisyes,thecompletescreenisusedbutnocommandsaresupported.
Whenthevalueismenu,commandscanbeusedaswell.
Thedefaultsettingisno.
Alternatively,youcandefinethepre-processingvariablepolish.
Full-screen.
Thisallowsafine-grainedcontrol,sincevariablescanhaveconditions.
groupsNoThepathtothegroups.
xmlfile.
Itdefaultstogroups.
xmlintheproject'sfolderorin${polish.
home}.
ContinuedAPPENDIX367TableA-12.
ContinuedAttributeRequiredExplanationimageLoadStrategyNoThestrategyforloadingpictures.
Possiblevaluesareforegroundandbackground.
Theforegroundstrategyloadsimagesdirectlywhentheyarerequested.
Thebackgroundstrategyloadstheimagesinabackgroundthread.
Withthebackgroundstrategy,theperceivedperformanceofanapplicationcanbeincreased,butnotallpicturesmightbeshownrightawaywhentheuserentersascreen.
ThedefinitionoftheimageLoadStrategymakessenseonlywhentheJ2MEPolishGUIisused(usePolishGui="true").
Thedefaultstrategyisforeground.
javacTargetNoThetargetfortheJavacompiler.
Bydefault,the"1.
2"targetisused,unlessaWTK1.
xorMacOSXisused,inwhichcasethetarget"1.
1"isused.
Youcanalsousethenestedelementforfurthersettings.
polishDirNoThedirectorycontainingthesourcesofJ2MEPolish.
ThisisingeneralusedonlybydevelopersoftheJ2MEPolishGUIitself.
replacePropertiesWithoutDirectiveNoYoucanuseAntpropertiesinyoursourcecodewithoutusingpreprocessingwhenyousetreplacePropertiesWithoutDirectivetotrue(e.
g.
,Stringmessage="Hello${polish.
Identifier}";).
sourceDirNoThepathtothesourcedirectory.
Thedefaultpathiseithersource/src,source,orsrc.
Youcandefineseveralpathsbyseparatingthemwithacolon(:)orasemicolon(;):[path1]:[path2].
Youcanalsoincludesourcedirectoriesbasedonconditionswhenthenestedelementisusedinstead.
symbolsNoProject-specificsymbols(e.
g.
,showSplash)thatyoucanthencheckwith//#ifdefshowSplashinthesourcecode.
Youcandefineseveralsymbolsbyseparatingthemwithcommas.
usePolishGuiNoDefineswhethertheJ2MEPolishGUIshouldbeusedatall.
Possiblevaluesaretrue/yes,false/no,andalways.
Whenthevalueistrue,theGUIwillbeusedonlyfordeviceswiththerecommendedcapabilities(e.
g.
,acolordepthofatleast8bits).
Whenthevalueisalways,theGUIwillbeusedforalldevices.
Thedefaultvalueistrue.
APPENDIX368AttributeRequiredExplanationvendorsNoThepathtothevendors.
xmlfile.
Itdefaultstovendors.
xmlintheproject'sfolderorin${polish.
home}.
workDirNoThetemporarybuildfolder.
Itdefaultstothebuilddirectory.
IncorporatingDifferentSourceFolders:andUsetheelementanditsnestedelementstoincludedifferentsourcedirectories.
Thiscanbeusefulwhenyouincludetestclassesorclassesthatrequirespecificlibraries,asdemonstratedinListingA-1.
TableA-13describestheattributesoftheelement;TableA-14describestheattributesoftheelement.
ListingA-1.
IncludingSourceFolderConditionallyTableA-13.
AttributesoftheElementAttributeRequiredExplanationifNoTheAntpropertythatneedstobetrueforthenestedsourcedirectoriestobeusedunlessNoTheAntpropertythatneedstobefalseforthenestedsourcedirectoriestobeusedTableA-14.
AttributesoftheElementAttributeRequiredExplanationdirYesThefolderthatcontainsJavasourcefilesifNoTheAntpropertyorthepreprocessingtermthatneedstobetrueforthissourcedirectorytobeusedunlessNoTheAntpropertyorthepreprocessingtermthatneedstobefalseforthissourcedirectorytobeusedDefiningMIDletClasses:andTheelementinthesectiondefinestheactualMIDletclass.
Youcanaddsev-eralelementsoruseaelementforgroupingthedefinitions,dependingonyourpreferences.
Inmostcases,yousimplyneedtospecifytheclass:APPENDIX369TableA-15liststheattributesoftheelement.
TableA-15.
AttributesoftheElementAttributeRequiredExplanationclassYesThecompletepackageandclassnameoftheMIDlet.
nameNoThenameoftheMIDlet.
Thedefaultistheclassnamewithoutthepackage.
TheMIDletcom.
company.
SomeMidletisnamedSomeMidlet,forexample.
iconNoTheiconofthisMIDlet.
Whennoneisdefined,theicondefinedinthesectionwillbeused.
numberNoThenumberofthisMIDlet.
ThisisinterestingonlyforMIDletsuitesthatcontainseveralMIDlets.
ifNoTheAntpropertyorthepreprocessingtermthatneedstobetrueforthisMIDlettobeincluded.
unlessNoTheAntpropertyorthepreprocessingtermthatneedstobefalseforthisMIDlettobeincluded.
SpecifyingVariables:andUsetheoptionalelementtodefineyourownpreprocessingvariables(seeChap-ter8)andtoconfigureJ2MEPolish(seeChapters7,11,and12).
Theelementinthesectioncontainsanarbitrarynumberofelements,whichdefinetheactualvariables.
Youcandirectlyspecifyvariablesorloadthemfromfiles.
TableA-16liststheattributesoftheelements.
TableA-16.
AttributesofElementAttributeRequiredExplanationnameYes,unlessfileisusedThenameofthevariable.
valueYes,unlessfileisusedThevalueofthevariable.
fileNoThefilethatcontainsseveralvariabledefinitions.
YoucanalsouseJ2MEPolishpropertiesinthefilename(e.
g.
,file="config/${lowercase{polish.
vendor)}.
properties").
Thisincludesvariabledefinitionsfromconfig/nokia.
propertieswhenyou'retargetingaNokiadevice.
Whenyouuseproperties,thefileisdeemedtobeoptional,soJ2MEPolishwillreportthatitismissing,butitcontinuesthebuildprocessnevertheless.
Inthefile,thevariablenamesandvaluesareseparatedbytheequalscharacter(=).
Emptylinesandlinesstartingwithahashmark(#)areignored.
APPENDIX370AttributeRequiredExplanationifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthisvariabletobeincluded.
unlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalseforthisvariabletobeincluded.
ControllingtheLogging:Theoptionalelementinthesectioncontrolstheinclusionofdebuggingmes-sagesforspecificclassesorpackageswhenyouusethe//#debugpreprocessingdirective.
PleaserefertoChapter9fordetails.
TableA-17liststheattributesoftheelement.
TableA-17.
AttributesoftheElementAttributeRequiredExplanationlevelNoThegeneraldebuglevelneededfordebugmessages.
Possiblevaluesaredebug,info,warn,error,fatal,andauser-definedlevel.
Thedefaultlevelisdebug,soallmessageswillbeincluded.
verboseNoWhenthevalueistrue,thetime,classname,andlinenumberwillbeincludedineachlogmessage.
Thedefaultisfalse.
Whenverbosemodeisenabled,thepreprocessingsymbolpolish.
debugVerboseisdefined.
Inverbosemode,exceptionsthrownbyJ2MEPolishcontainusefulinformation.
Also,thekeyhandlingandanimationhandlingaremonitoredanderrormessagesareprovided.
showLogOnErrorNoWhenthevalueistrue,thelogcontainingallloggingmessagesisshownwheneveranexceptionislogged.
ThelogisshownautomaticallyonlywhentheJ2MEPolishGUIisused.
ifNoThenameoftheAntpropertythatneedstocontaintrueoryeswhenthiselementshouldbeused.
Whentheelementisactivated,thepreprocessingsymbolpolish.
debugEnabledisdefined.
unlessNoThenameoftheAntpropertythatneedstobefalseornowhenthiselementshouldbeused.
Forfinercontroloverthedebuggingprocess,theelementallowsthesubelement,whichdefinesthedebuglevelforspecificclassesorpackages.
TableA-18liststheattributesoftheelement.
APPENDIX371TableA-18.
AttributesoftheElementAttributeRequiredExplanationclassYes,unlesspackageisusedThefullyqualifiednameoftheclass.
levelYesThedebugginglevelforthespecifiedclassorforallclassesofthespecifiedpackage.
Possiblevaluesaredebug,info,warn,error,fatal,andauser-definedlevel.
packageNoThenameofthepackage.
Youcanalsoforwardmessagestologhandlersusingthenestedelement,whichsupportstheattributeslistedinTableA-19.
TableA-19.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessclientClassisusedThenameoftheloghandlerasregisteredinextensions.
xmlorcustom-extensions.
xml(e.
g.
,rmsforstoringlogentriesintherecordstore)clientClassNoThenameoftheclassthatextendsde.
enough.
polish.
log.
LogHandlerIncludingAdditionalPreprocessors:Youcanaddyourownpreprocessorsformodifyingthesourcecodebeforeitiscompiled.
Justspecifytheelementinthesection.
Youcanalsoinvokespecificpreprocessorsautomatically(withouttheelement)bydefiningthebuild.
Preprocessorcapabilityin${polish.
home}/custom-devices.
xml.
PleaserefertoChapter13formoredetails.
TableA-20liststheattributesoftheelement.
TableA-20.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessclassisusedThenameofthepreprocessorasregisteredincustom-extensions.
xmlclassNoThefullyqualifiednameoftheclassthatextendsde.
enough.
polish.
preprocess.
CustomPreprocessorclassPathNoTheclasspathfromwhichthepreprocessorcanbeloadedtargetNoSpecifiestheAnttargetthatyouwanttocallwhenyouusetheantcallpreprocessor:APPENDIX372AttributeRequiredExplanationifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthispreprocessortobeusedunlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalseforthispre-processortobeusedAswitheveryextension,youcanusenestedelementstoconfiguretheelement:.
ControllingtheCompilation:Usetheoptionalelementinthesectiontospecifyanycompilerargu-ments.
J2MEPolishnormallycallstheJavacompilerwiththeappropriateclasspathaswellasbootclasspathforthecurrenttargetdevice.
Insomecases,youmightwanttoadjustthecompilersettings,however,soyoucanusethenestedelement.
Alongwithallattributesofthestandardtask,theelementalsosupportstheifandunlessattributesforselectingtoappropriatecompilersetting.
TableA-21liststheavailableattributesoftheelement.
TableA-21.
AvailableAttributesAttributeRequiredExplanationbootclasspathNoThelocationofbootstrapclassfiles.
J2MEPolishuseseithertheplatformspecificlibraryfilesforthebootclasspath(e.
g.
,midp1.
jarormidp2-cldc11.
jar).
bootclasspathrefNoThelocationofbootstrapclassfiles,givenasareferencetoapathdefinedelsewhere.
classpathNoTheclasspathtouse.
J2MEPolishincludesallsupportedlibrariesofthecurrenttargetdevicebydefault.
classpathrefNoTheclasspathtouse,givenasareferencetoapathdefinedelsewhere.
compilerNoThecompilerimplementationtouse.
Ifthisattributeisnotset,thevalueofthebuild.
compilerproperty,ifset,isused.
Otherwise,thedefaultcompilerforthecurrentVMisused.
debugNoIndicateswhethersourceshouldbecompiledwithdebuginformation.
Thedefaultisoff.
Ifthisissettooff,-g:nonewillbepassedonthecommandlineforcompil-ersthatsupportit(forothercompilers,nocommandlineargumentwillbeused).
Ifthisissettotrue,thevalueofthedebuglevelattributedeterminesthecommandlineargument.
J2MEPolishenablesdebuggingonlywhentheelementisactiveforthecurrenttargetdevice.
ContinuedAPPENDIX373TableA-21.
ContinuedAttributeRequiredExplanationdebuglevelNoAkeywordlisttobeappendedtothe-gcommandlineswitch.
Thiswillbeignoredbyallimplementationsexceptmodernandclassic(versions>=1.
2).
Legalvaluesarenoneoracomma-separatedlistofthefollowingkey-words:lines,vars,andsource.
Ifdebuglevelisnotspecified,bydefaultnothingwillbeappendedto-g.
Ifdebugisnotturnedon,thisattributewillbeignored.
dependNoEnablesdependencytrackingforcompilersthatsupportthis(jikesandclassic).
deprecationNoIndicateswhethersourceshouldbecompiledwithdep-recationinformation.
Thedefaultisoff.
destdirNoThelocationtostoretheclassfiles.
Thisdefaultstothetemporarybuilddirectoryintowhichclassfilesarewrit-tenbeforetheyareobfuscated.
encodingNoTheencodingofsourcefiles.
(Note:gcjdoesn'tsupportthisoptionyet.
)excludesNoAcomma-orspace-separatedlistoffiles(maybespeci-fiedusingwildcardpatterns)thatmustbeexcluded;nofiles(exceptdefaultexcludes)areexcludedwhenthisattributeisomitted.
excludesfileNoThenameofafilethatcontainsalistoffilestoexclude(maybespecifiedusingwildcardpatterns).
executableNoCompletepathtothejavacexecutabletouseincaseoffork="yes".
ItdefaultstothecompileroftheJavaversionthatiscurrentlyrunningAnt.
Itisignorediffork="no".
SinceAnt1.
6,thisattributecanalsobeusedtospecifythepathtotheexecutablewhenusingjikes,jvc,gcj,orsj.
extdirsNoThelocationofinstalledextensions.
failonerrorNoIndicateswhetherthebuildwillcontinueeveniftherearecompilationerrors.
Thedefaultistrue.
forkNoIndicateswhethertoexecutejavacusingtheJDKcom-pilerexternally.
Thedefaultisno.
ifNoTheAntpropertythatneedstobetrueorthepreprocess-ingtermthatneedstoresultintrueforthiscompilersettingtobeused.
includeAntRuntimeNoIndicateswhethertoincludetheAntruntimelibrariesintheclasspath.
Thedefaultisfalse.
includeJavaRuntimeNoIndicateswhethertoincludethedefaultruntimelibrariesfromtheexecutingVMintheclasspath.
Thedefaultisno.
includesNoAcomma-orspace-separatedlistoffiles(maybespeci-fiedusingwildcardpatterns)thatmustbeincluded.
All.
javafilesareincludedwhenthisattributeisomitted.
includesfileNoThenameofafilethatcontainsalistoffilestoinclude(maybespecifiedusingwildcardpatterns).
listfilesNoIndicateswhetherthesourcefilestobecompiledarelisted.
Thedefaultisno.
APPENDIX374AttributeRequiredExplanationmemoryInitialSizeNoTheinitialsizeofthememoryfortheunderlyingVM,ifjavacisrunexternally;otherwise,itisignored.
ItdefaultstothestandardVMmemorysetting(e.
g.
,83886080,81920k,or80m).
memoryMaximumSizeNoThemaximumsizeofthememoryfortheunderlyingVM,ifjavacisrunexternally;otherwise,itisignored.
ItdefaultstothestandardVMmemorysetting(e.
g.
,83886080,81920k,or80m).
nowarnNoIndicateswhetherthe-nowarnswitchshouldbepassedtothecompiler.
Thedefaultisoff.
optimizeNoIndicateswhethersourceshouldbecompiledwithopti-mization.
Thedefaultisoff.
sourceNoThevalueofthe-sourcecommandlineswitch.
Itwillbeignoredbyallimplementationspriortojavac1.
4(ormodernwhenAntisnotrunningina1.
3VM)andjikes.
Ifyouusethisattributetogetherwithjikes,youmustmakesurethatyourversionofjikessupportsthe-sourceswitch.
Legalvaluesare1.
3,1.
4,and1.
5;bydefault,the1.
3sourceswitchwillbeused.
sourcepathNoThesourcepathtouse,whichdefaultstothevalueofthesrcdirattribute.
Tosuppressthesourcepathswitch,usesourcepath="".
sourcepathrefNoThesourcepathtouse,givenasareferencetoapathdefinedelsewhere.
srcdirNoThelocationoftheJavafiles.
Thisdefaultstothetempo-rarydirectorytowhichthepreprocessedfilesarewritten.
targetNoGeneratesclassfilesforspecificVMversion(e.
g.
,1.
1or1.
2).
J2MEPolishuses1.
2bydefaultwhentheWTK2.
xisused.
ThetargetcanalsobesetwiththejavacTargetattributeoftheelement.
tempdirNoThelocationwhereAntshouldplacetemporaryfiles.
Thisisonlyusedifthetaskisforkedandthecommandlineargument'slengthexceeds4KB.
unlessNoTheAntpropertythatneedstobefalseortheprepro-cessingtermthatneedstoresultinfalseforthiscompilersettingtobeused.
verboseNoAsksthecompilerforverboseoutput.
Thedefaultisno.
Youcanspecifyadditionalcommandlineargumentsforthecompilerwithnestedelements.
Theseelementsarespecifiedlikecommandlineargumentsbuthaveanadditionalattributethatcanbeusedtoenableargumentsonlyifagivencompilerimplementationwillbeused.
TableA-22liststheattributesoftheelement.
APPENDIX375TableA-22.
AttributesoftheElementAttributeRequiredExplanationcompilerNoOnlypassthespecifiedargumentifthechosencompilerimplementationmatchesthevalueofthisattribute.
fileEithervalue,line,file,orpathThenameofafileasasinglecommandlineargument;willbereplacedwiththeabsolutefilenameofthefile.
lineEithervalue,line,file,orpathAsinglecommandlineargument;cannotcontainspacecharacters.
pathEithervalue,line,file,orpathAstringthatwillbetreatedasapath-likestringasasinglecommandlineargument.
Youcanuse;or:toseparatepathentries.
valueEithervalue,line,file,orpathAsinglecommand-lineargument;cancontainspacecharacters.
ProcessingtheCompiledBytecode:Aftercompilingthesourcecode,youcanprocessthebytecodeusingapostcompiler.
AnexampleincludestheFloatertoolofEnoughSoftwarethatallowsyoutousefloating-pointcal-culationsonCLDC1.
0devicesaswell.
Whenyoudefinethebuild.
Postcompilercapabilityin${polish.
home}/custom-devices.
xml,thenamedpostcompilerisinvokedautomaticallyfortheaffecteddevices.
RefertoChapter13formoredetailsaboutpostcompiling.
TableA-23liststheattributesoftheelement.
TableA-23.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessclassisusedThenameofthepostcompilerasregisteredincustom-extensions.
xmlortheJ2MEPolishinternalextensions.
xmlfile.
classNoThefullyqualifiednameoftheclassthatextendsde.
enough.
polish.
postcompile.
PostCompiler.
classPathNoTheclasspathfromwhichthepostcompilercanbeloaded.
targetNoUsetospecifytheAnttargetthatyouwanttocallwhenyouusetheantcallpostcompiler:.
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthispostcompilertobeused.
unlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalseforthispostcompilertobeused.
APPENDIX376Youcanusenestedelementsforconfiguringtheelement:.
ShrinkingandObfuscatingJ2MEApplications:Controltheshrinkingandobfuscationofyourapplicationswiththeoptionalelementinyoursection.
ObfuscationdecreasestheJARfilesizeandmakesitdifficulttoreverse-engineeryourapplication.
EnabletheProGuardobfuscatorwiththiscodesnippet:TableA-24liststheattributesoftheelement.
TableA-24.
AttributesoftheElementAttributeRequiredExplanationnameNoThenameoftheobfuscatorthatshouldbeused.
ThedefaultisProGuard;otherpossiblevaluesareJuicer,ProGuard,KlassMaster,Dasho,yGuard,RetroGuard,andantcall.
useDefaultPackageNoJ2MEPolishcanmoveallclassestothedefaultpackageforyou.
ThisincludestheMIDletclassesaswellandcanresultinasmallerJARfilesize.
Pleasenotethatyouareresponsibleforpreventingclassnameclashes.
Youdonotneedtoadjustyoursettings;thisisdoneautomaticallybyJ2MEPolish.
Youdoneed,however,toadjustanysettingsyouhave.
useDefaultPackagedefaultstofalse.
Usetheclassnamepropertyfunctiontoadjusttheloadingofdynamicclasses.
ifNoThenameoftheAntpropertyorthepreprocessingtermthatneedstobetrueifthiselementshouldbeused.
unlessNoThenameoftheAntpropertyorthepreprocessingtermthatneedstobefalseifthiselementshouldbeused.
classNoTheclassthatcontrolstheobfuscator.
Eachclassthatextendsde.
enough.
polish.
obfuscate.
Obfuscatorcanbeused.
classPathNoTheclasspathforthisobfuscator.
Thisisusefulforintegratingathird-partyobfuscator,incaseyoudon'twanttoregisteritin${polish.
home}/custom-extensions.
xml.
targetNoThetargetinyourbuild.
xmlfilethatshouldbecalledwhenyouusetheantcallobfuscator.
Youcancombineseveralobfuscatorsinaprojectjustbydefiningseveralelements.
Usethenestedelementsandtoconfiguretheobfuscator.
ExcludingDynamicClassesfromObfuscation:UsethenestedelementtodefineclassesthatareloadeddynamicallywithClass.
forName(),asdemonstratedinListingA-2.
TheelementsupportsonlytheclassAPPENDIX377attributethatcontainsthenamesoftheclassesthatshouldbesparedfromobfuscation.
YoudonotneedtoaddyourMIDletclasses,sinceyouhavethemdefinedwiththeattri-butesalready.
ListingA-2.
KeepingDynamicClassesinYourProjectConfiguringanObfuscator:Usethenestedelement(seeTableA-25foritsattributes)toconfigureanyobfus-cator,asshowninListingA-3.
ListingA-3.
ConfiguringYourObfuscatorTableA-25.
AttributesoftheElementAttributeRequiredExplanationnameYesThenameoftheparametervalueYesThevalueoftheparameterCombiningSeveralObfuscatorsCombineseveralobfuscatorsbyspecifyingseveralelements.
Whenyouusesubelements,youneedonlyspecifytheminoneelement.
SpecificObfuscatorSettingsProGuardProGuardisanexcellentobfuscator,shrinker,andoptimizerbyEricLafortune.
ItisfreelyavailableundertheGNUGeneralPublicLicenseandcanbedownloadedfromhttp://proguard.
sourceforge.
net.
YoucanuseProGuardbysettingthenameattributeoftheelementtoProGuard.
ProGuard3.
xoffersanadditionaloptimizationofthebytecode,whichisdisabledbydefault.
Youcanenabletheoptimizationbysettingtheoptimizeparametertotrue,asshowninListingA-4.
Thisimprovestheshrinkingoftheclassfilesabit.
ListingA-4.
ActivatingBytecodeOptimizationsinProGuardAPPENDIX378Atextfilethatlistsallrenamingoperationsiswrittentobuild/[vendor]/[device]/[locale]/obfuscation-map.
txt.
Thisfileisusefulifyougetexceptionsintheobfuscatedapplication.
yGuardTheyGuardobfuscatorbytheyWorksGmbHisanotherinterestingobfuscatorandcodeshrinker.
J2MEPolishincludesthelibraryclasses,whicharelicensedundertheGNULesserGeneralPublicLicense.
Thefullobfuscatorisfreelyavailablefromhttp://www.
yworks.
de.
TheyGuardobfuscatorcanbeusedbysettingthenameattributeoftheele-menttoyGuard:RetroGuardRetroGuardisthebasisofbothyGuardandProGuard,andwasdevelopedbyRetro-logicSystems/MarkWelsh.
ItislicensedundertheGNULesserGeneralPublicLicenseandisincludedinJ2MEPolishbydefault.
Youcandownloaditfromhttp://www.
retrologic.
com.
YoucanuseRetroGuardjustbysettingthenameattributetoRetroGuard:ZelixKlassMasterKlassMasterisacommercialobfuscatoravailablefromZelixPtyLtd.
Youcanrequestafreeevaluationversionathttp://www.
zelix.
com.
TheKlassMasterintegrationallowsyoutospecifythefollowingparameters:enableFlowObfuscation:Theflowobfuscationincreasesnotonlythesecurityoftheapplication,buttheapplicationsizeaswell.
Itisthereforedeactivatedbydefault.
ActivateitbysettingtheenableFlowObfuscationparametertotrue.
ObfuscateFlowLevel:Youcanalsosettheobfuscationflowleveldirectly(e.
g.
,noneoraggressive).
ThisparametertakesprecedenceovertheenableFlowObfuscationparameter.
ScriptFile:Youcanalsosetthefilecontainingthefullscript.
Inthatcase,pleasenotethatthesourceJARfileisalwaysbuild/source.
jarandthetargetfileisbuild/dest.
jar.
ListingA-5showsapossibleinvocationofKlassMaster.
ListingA-5.
UsingtheKlassMasterObfuscatorDashOProDashOProisacommercialobfuscatorbyPreemptiveSolutions.
Youcanrequestafreeevaluationversionathttp://www.
preemptive.
com.
WhentheDashOProobfuscatorisused,eithertheAntpropertydasho.
homeorthepara-meterDashoHomeneedstobeprovided.
Theclasspathdoesnotneedtobemodified.
TheDashOProobfuscatorsupportstheparameterslistedinTableA-26.
APPENDIX379TableA-26.
ParametersoftheDashOObfuscatorNameExplanationConstantPoolTagAtagaddedtoallprocessedclasses.
Thistagisvisibleonlywhenadecompilerisused.
DashoHomeNeedstopointtotheinstallationdirectoryoftheDashOProobfuscator.
enableFlowObfuscationWhenthevalueistrue,DashOwillobfuscatetheapplicationflowaswell.
Thisisdeactivatedbydefault.
enableOptimizationWhenthevalueistrue,thebytecodewillbeoptimizedbyDashO.
Thisfeatureisactivatedbydefault.
enableRenamingWhenthevalueistrue,allpossibleclasseswillberenamed.
Thisisactivatedbydefault.
enableStringEncriptionWhenthevalueistrue,StringswillbeobfuscatedbyDashOaswell.
Sincethisdecreasestheperformance,itisdeactivatedbydefault.
ScriptFileThefilecontainingthefullscriptcanalsobeset.
Inthatcase,pleasenotethatthesourceJARfileisalwaysbuild/source.
jarandthetargetfileisbuild/dest.
jar.
VersionNeedstocorrespondtotheusedversionofDashO.
Thecurrentdefaultversionis3.
1.
Areportabouttherenamedclassesaswellasmethodsiswrittentobuild/[vendor]/[device]/[locale]/obfuscation-map.
txt.
Thisfileisusefulforresolvingstacktracesintheobfus-catedapplication.
ListingA-6showsyouhowtousetheDashOobfuscatorinJ2MEPolish.
ListingA-6.
UsingtheDashOObfuscatorPreverifyingtheApplication:Youcanuseaspecificpreverifierbydefiningtheelementinthesection(seeTableA-27fortheelement'sattributes).
Alternatively,youcanspecifythebuild.
Preverifycapabilityincustom-devices.
xml,sothatthespecifiedpreverifierisusedautomaticallyfortheaffecteddevices.
SeeChapter13formoredetails.
TableA-27.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessclassThenameofthepreverifierasregisteredinisusedcustom-extensions.
xmlortheJ2MEPolishinternalextensions.
xmlfile.
Thenonepreverifierskipsthecompletepreverificationstep.
classNoThefullyqualifiednameoftheclassthatextendsde.
enough.
polish.
preverify.
Preverifier.
APPENDIX380AttributeRequiredExplanationclassPathNoTheclasspathfromwhichthepreverifiercanbeloaded.
targetNoSpecifiestheAnttargetthatyouwanttocallwhenyouusetheantcallpreverifier:.
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthispreverifiertobeused.
unlessNoTheAntpropertythatneedstobefalseortheprepro-cessingtermthatneedstoresultinfalseforthispreverifiertobeused.
Again,youcanusenestedelementsforconfiguringtheelement:.
AssemblingtheResources:Usetheelementinthesectiontocontroltheresourceassemblingaswellasthelocalizationoftheapplication,asdemonstratedinListingA-7.
Pleaserefertothe"ResourceAssembling"sectionofChapter7formoredetails.
TableA-28liststheattributesoftheelement.
ListingA-7.
EnablingtheLocalizationandIncludingSpecificResourcesAPPENDIX381TableA-28.
AttributesoftheElementAttributeRequiredExplanationdirNoThedirectorycontainingallresources.
Thisdefaultstotheresourcesfolder.
defaultexcludesNoEitheryes/trueorno/false;defineswhethertypicalfilesshouldnotbecopiedintheapplicationJARbundleduringpackaging.
Thefilespolish.
cssandThumbs.
db,anybackupfiles(*.
bakand*~),andthemessagefilesusedinthelocalizationareexcludedbydefault.
excludesNoAdditionalfilesthatshouldnotbeincludedintheJARfilescanbedefinedusingtheexcludesattribute.
Severalfilesneedtobeseparatedbycommas.
Useastartoselectseveralfilesatonce(e.
g.
,excludes="*.
txt,readme*").
localesNoThelocalesthatshouldbesupportedinacomma-separatedlist.
Alternatively,thenestedelementcanbeused.
ThestandardJavalocaleabbrevi-ationsareused(e.
g.
,deforGerman,enforEnglish,fr_CAforCanadianFrench,etc.
).
SelectingAdditionalFiles:Usetheelementtoincludespecificresources.
ThiselementbehaveslikeanyAnt,butitofferstheadditionalifandunlessattributes,allowingforfine-grainedcontrol.
TableA-29liststheattributesoftheelement.
TableA-29.
AttributesoftheElementAttributeRequiredExplanationdirYesThebasedirectoryofthisfileset.
Thisdirectoryneedstoexist.
includesYesDefineswhichfilesshouldbeincluded(e.
g.
,includes="*.
mid").
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthisfilesettobeincluded.
unlessNoTheAntpropertythatneedstobefalseortheprepro-cessingtermthatneedstoresultinfalseforthisfilesettobeincluded.
ControllingtheLocalization:Controltheinternationalizationofyourapplicationwiththeelement.
TheattributesofthiselementappearinTableA-30.
APPENDIX382TableA-30.
AttributesoftheElementAttributeRequiredExplanationlocalesYesThelocalesthatshouldbesupportedinacomma-separatedlist.
ThestandardJavalocaleabbreviationsareused(e.
g.
,deforGerman,enforEnglish,fr_CAforCanadianFrench,etc.
).
messagesNoThefilethatcontainsthetranslations.
Thisdefaultstomessages.
txt.
dynamicNoDefineswhetherdynamictranslationsshouldbeenabled.
Dynamictranslationscanbechangedduringruntimebycallingde.
enough.
polish.
util.
Locale.
loadTranslations(Stringurl).
Thisrequiresadditionalresourcesanddefaults;thereforethedefaultisfalse.
defaultNoThedefaultlocalization.
Thismakessenseonlywhendynamictranslationsareenabled.
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthislocalizationtobeused.
unlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalseforthislocalizationtobeused.
RenamingandTransformingResources:Youcanrenameandtransformresourcesbyusingthenestedelementinsideoftheelement.
TheexampleinListingA-8renamesfilesautomaticallyandusesnestedelementsfortheconfiguration.
RefertoChapter13formoredetailsaboutthisoption.
TableA-31liststheattributesoftheelement.
ListingA-8.
RenamingResourcesontheFlyAPPENDIX383TableA-31.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessclassThenameofthecopierasregisteredinisusedcustom-extensions.
xmlortheJ2MEPolishinternalextensions.
xmlfile.
classNoThefullyqualifiednameoftheclassthatextendsde.
enough.
polish.
resources.
ResourceCopier.
classPathNoTheclasspathfromwhichthecopiercanbeloaded.
targetNoSpecifiestheAnttargetthatyouwanttocallwhenyouusetheantcallcopier:.
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthiscopiertobeused.
unlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalseforthiscopiertobeused.
PackagingtheApplication:Whenyourapplicationhasbeencompiled,obfuscated,andpreverified,andwhenallresourceshavebeenselected,youarereadytocreatetheJARpackage.
UsuallyJ2MEPolishusesthedefaultJavaZIPmechanismfordoingthis,butyoucanchoosedifferentmechanismswiththeelementnestedinsidethesection;pleaserefertothe"Packaging"sectionofChapter7andtoChapter13forthedetails.
TableA-32liststheattributesoftheelement.
TableA-32.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessclassorThenameofthepackagerasregisteredinexecutableisusedcustom-extensions.
xmlortheJ2MEPolishinternalextensions.
xmlfile(e.
g.
,7zip,kziporantcall).
executableNoTheexternalapplicationthatshouldbeinvokedtocreatetheJARfile(e.
g.
,jar).
argumentsNoTheargumentsforthepackager.
Separateargumentswithdoublesemicolons(;;).
AnyAntpropertiesaswellasJ2MEPolishvariablescanbeused.
Oftenneededvariablesareasfollows:${polish.
jarPath}:ThefullpathtotheJARfilethatshouldbecreated${polish.
packageDir}:Thedirectorythatcontainstheclassesandtheresourcesthatshouldbepackaged.
classNoThefullyqualifiednameoftheclassthatextendsde.
enough.
polish.
jar.
Packager.
APPENDIX384AttributeRequiredExplanationclassPathNoTheclasspathfromwhichthepackagercanbeloaded.
targetNoSpecifiestheAnttargetthatyouwanttocallwhenyouusetheantcallpackager:.
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrue,whenthispackagershouldbeused.
unlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalse,whenthispackagershouldbeused.
Youcanusenestedelementsforconfiguringthepackager.
TableA-33liststhesupportedparametersofthe7-Zippackager,andTableA-34liststhepossibleparameterfortheKZIPpackager.
TableA-33.
ParametersforConfiguringthe7-ZipPackagerParameterRequiredExplanationcompressionNoThelevelofcompression,eithermaximum,normal,ornonepassesNoSetsthenumberofcompressionruns,anumberbetween1and4fastbytesNoSpecifiesthesizeofinternalcompressionchunks,anumberbetween3and255TableA-34.
ParameterforConfiguringtheKZIPPackagerParameterRequiredExplanationblocksplitNoThesizeofthecompressedblocks,anumberbetween0and2048.
Testthevalues128,256,512,1024,and2048forbestcom-pression.
SpecifyingandSortingJADandManifestattributes:,,andNormalJADattributesaredefinedinthesection,butyoucanspecifyadditionalset-tingswiththeelementinthesection.
Pleaserefertothe"JADandManifestAttributes"sectionofthisappendixforexamplesofspecificattributesandtothe"ManagingJADandManifestAttributes"sectionofChapter7formoreinformationabouthandlingandsortingsuchattributes.
TableA-35liststheattributesoftheelement.
APPENDIX385TableA-35.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessfileThenameoftheattributeisused(e.
g.
,Nokia-MIDlet-Category).
valueYes,unlessfileThevalueoftheattribute.
isusedfileNoThefilethatcontainsseveralattributedefinitions.
Separatenamesandvaluesinthefilewithcolons(:).
Emptylinesandlinesstartingwithahashmark(#)areignored.
YoucanalsouseJ2MEPolishvariablesinthefilename(e.
g.
,file="config/${polish.
Vendor}.
jad").
targetNoEitherjad,manifest,orjad,manifest.
Auser-definedattributeisaddedtoboth,theMANIFESTaswellastheJAD,bydefault.
Thespecificationsaysuser-definedattributesshouldonlybeaddedtotheJADfile,buttherearesomedevicesouttherethatexpecttheseattributesintheMANIFESTaswell.
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthisattributetobeincluded.
unlessNoTheAntpropertythatneedstobefalseortheprepro-cessingtermthatneedstoresultinfalseforthisattributetobeincluded.
YoucansortJADattributesbyusingthenestedelementintheelementasdemonstratedinListingA-9.
Youcanusetheifandunlessattributesforusingdifferentfiltersdependingonthecurrenttargetdevice.
ListingA-9.
SortingJADAttributeswithMIDlet-Name,MIDlet-Version,MIDlet-Vendor,MIDlet-Jar-URL,MIDlet-Jar-Size,MIDlet-Description,MIDlet-Icon,MIDlet-Info-URL,MIDlet-Data-Size,MIDlet-*,*YoucanalsosortManifestattributesbyusingaineitherthesectionorintheelement.
Again,youcanusetheifandunlessattributestousediffer-entfiltersdependingonthecurrenttargetdevice.
Whenusinga,makesurethattheManifest-Versionattributeisalwaysincludedasthefirstattribute;otherwise,yourManifestwon'tbevalid.
APPENDIX386FinishingtheBuild:andAfterJ2MEPolishhascreatedtheJARandtheJADfile,itcaninvoketheoptionalelementnestedinthesection.
Oneexampleofafinalizeristhejar2codfinalizer,whichautomaticallyconvertsJARtoCODfilesforBlackberrydevices.
Youcandefinethecapabilitybuild.
Finalizertoinvokefinalizersautomatically,withoutusingaspecificelementinyourbuild.
xmlscript.
Chapter13describesfurtherdetails.
TableA-36liststheattributesoftheelement.
TableA-36.
AttributesoftheElementAttributeRequiredExplanationnameYes,unlessclassThenameofthefinalizerasregisteredinisusedcustom-extensions.
xmlortheJ2MEPolishinternalextensions.
xmlfileclassNoThefullyqualifiednameoftheclassthatextendsde.
enough.
polish.
finalize.
FinalizerclassPathNoTheclasspathfromwhichthefinalizercanbeloadedtargetNoSpecifiestheAnttargetthatyouwanttocallwhenyouusetheantcallfinalizer:ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintrueforthisfinalizertobeusedunlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalseforthisfinalizertobeusedAspecializedfinalizerelementis,whichcanalsobenestedinsideofthesection.
UsetheelementtoautomatethesigningofyourMIDP2.
0applications(seeTableA-37foritsattributes).
Pleaseseethe"SigningApplications"sectionofChapter7fordetails.
TableA-37.
AttributesoftheElementAttributeRequiredExplanationkeyYesThenameofthekeythatshouldbeusedforsigning.
keystoreYesThepathtothekeystorethatcontainsthesigningkey.
passwordYesThepasswordforsigning.
YoucanuseanAntpropertylike${pw}andspecifythepropertyonthecommandline,sothatthepasswordisnotstoredinthebuild.
xmlfile:ant-Dpw=secret.
unlessNoTheAntpropertythatneedstobefalseorthepreprocess-ingtermthatneedstoresultinfalseforthesigningtobeused.
APPENDIX387EmulatorSectionTheelementisresponsibleforlaunchinganyemulatorsafteryourapplicationhasbeenbuilt.
TableA-38liststheattributesoftheelement.
TableA-38.
AttributesoftheElementAttributeRequiredExplanationwaitNoEitheryes/trueorno/false;defineswhethertheJ2MEPolishtaskshouldwaituntiltheemulatorisfinished.
ThisisneededwhenanyoutputshouldbeshownontheAntoutput;therefore,itdefaultstoyes.
traceNoDefinesifanyvirtualmachineactivitiesshouldbeshownontheoutput.
Possiblevaluesareclassforshowingtheloadingofclasses,gcforgarbagecollectionactivities,andallforaveryextensiveoutput.
Severalcomma-separatedvaluescanbeprovided(e.
g.
,class,gc).
securityDomainNoTheMIDP2.
0securitydomainoftheapplication:eithertrusted,untrusted,minimum,ormaximum.
Intrustedandmaximummode,allsecurity-sensitiveactivitiesareallowed.
Inuntrustedmode,theuserwillbequestionedbeforeeachsecurity-sensitiveactivity.
Inminimummode,nosecurity-sensitiveactivitywillbeallowed.
enableProfilerNoEitheryes/trueorno/false.
Whenthisattributeisactivated,theperformancewillbeprofiledduringtheexecutionoftheapplication.
Theresultswillbeshownwhentheemulatoritselfisclosed.
enableMemoryMonitorNoEitheryes/trueorno/false.
Whenthisattributeisactivated,thememoryusageoftheapplicationwillbeshown.
enableNetworkMonitorNoEitheryes/trueorno/false.
Whenanynetworkactivitiesaredone,amonitorwillshowdetailsofthesentandreceiveddata.
preferencesNoThefilethatcontainstheemulatorpreferences.
Whensuchafileisused,theprofilerandmonitorsettingsareignored.
PleaseconsulttheWTKdocumentationfordetailedinformationaboutthepreferencesfile.
showDecompiledStackTraceNoEitheryes/trueorno/false;determineswhetheradecompiledstacktraceshouldbeshown,evenwhenthesourcecodepositionofanexceptioncouldbelocated.
ifNoTheAntpropertyorpreprocessingtermthatneedstobetruewhentheelementshouldbeexecuted.
unlessNoTheAntpropertyorpreprocessingtermthatneedstobefalsewhentheelementshouldbeexecuted.
APPENDIX388Youcanforwardanyparameterstotheemulatorbyusingnestedelementswithnameandvalueattributes(seeTableA-39).
TableA-39.
ConfiguringtheEmulatorwithNestedElementsAttributeRequiredExplanationnameYesThenameoftheparameter.
valueYesThevalueoftheparameter.
ThevaluecanuseanyJ2MEPolishoruser-definedvariable.
Thefollowingvariablesareespeciallyuseful:${polish.
jadName}:ThenameoftheJADfile${polish.
jadPath}:TheabsolutepathoftheJADfile${polish.
jarName}:ThenameoftheJARfile${polish.
jarPath}:TheabsolutepathoftheJARfile${polish.
classes.
midlet-1}:ThemainMIDletclass${polish.
classes.
midlet-2}:ThesecondMIDletclass,ifany${polish.
classes.
midlet-n}:ThenthMIDletclass,ifanyWhenonlyacommandlineswitchshouldbedefined,justdefineanemptyvalue(e.
g.
,).
ifNoTheAntpropertythatneedstobetrueorthepreprocessingtermthatneedstoresultintruewhenthisparametershouldbeused.
unlessNoTheAntpropertythatneedstobefalseorthepreprocessingtermthatneedstoresultinfalsewhenthisparametershouldbeused.
StandardPreprocessingVariablesandSymbolsYoucanevaluate,compare,anduseallvaluesoftheJ2MEPolishdevicedatabase(seeChapter6)inyourcodebyusingpreprocessing(seeChapter8).
Youcanalsodefineyourproject-specificvariablesandsymbolsinthebuild.
xmlscript(seeChapter8).
Withsuchvariables,youcanalsoconfiguremanyaspectsoftheJ2MEPolishGUI(seeChapter12)aswellasthegameengine(seeChapter11).
Device-SpecificSymbolsUsepreprocessingsymbolsinthe//#ifpreprocessingdirectivesorintheifandunlessattributesofmanyconditionalelementsofthetaskinyourbuild.
xmlfile.
Don'tforgettocheckoutallavailablepreprocessingsymbolsofyourtargetdeviceathttp://www.
j2mepolish.
org/devices-overview.
html.
TableA-40liststhestandardpreprocessingsymbols.
APPENDIX389TableA-40.
StandardDevice-SpecificPreprocessingSymbolsSymbolExplanationpolish.
api.
[name]ThetargetdevicesupportstheAPI[name]polish.
api.
3dThetargetdevicesupportstheMobile3DGraphicsAPIpolish.
api.
btapiThetargetdevicesupportstheBluetoothAPIpolish.
api.
mmapiThetargetdevicesupportstheMultimediaAPIpolish.
api.
nokia-uiThetargetdevicesupportstheNokiaUIAPIpolish.
api.
pdaapiThetargetdevicesupportsthePDAAPI(FileConnectionAPIandPIMAPI)polish.
api.
wmapiThetargetdevicesupportstheWirelessMessagingAPIpolish.
audio.
[name]Thetargetdevicesupportsthe[name]audioformatpolish.
audio.
midiThetargetdevicesupportstheMidiaudioformatpolish.
audio.
amrThetargetdevicesupportstheAMRaudioformatpolish.
cldc1.
0ThetargetdevicesupportstheCLDC1.
0configurationpolish.
cldc1.
1ThetargetdevicesupportstheCLDC1.
1configurationpolish.
group.
[name]Thetargetdevicebelongstothegroup[name]polish.
group.
Series40ThetargetdevicebelongstotheSeries40grouppolish.
group.
Series60ThetargetdevicebelongstotheSeries60grouppolish.
group.
Series60E2FP3ThetargetdevicebelongstotheSeries60,secondedition,featurepack3grouppolish.
hasCameraThetargetdevicecontainsacamerapolish.
hasCommandKeyEventsThetargetdevicetriggerskeyPressed()eventswhentheuserpressesasoftkeypolish.
hasPointerEventsThetargetdevicesupportsastyluspolish.
image.
[name]Thetargetdevicesupportsthe[name]imageformatpolish.
image.
jpegThetargetdevicesupportstheJPEGimageformatpolish.
jtwiThetargetdevicesupportstheJTWIspecificationpolish.
midp1ThetargetdevicesupportstheMIDP1.
0profilepolish.
midp2ThetargetdevicesupportstheMIDP2.
0profilepolish.
midp3ThetargetdevicesupportstheMIDP3.
0profilepolish.
supportSpriteTransformationTheMIDP1.
0targetdevicesupportsspritetransformationsintheJ2MEPolishgameenginepolish.
video.
[name]Thetargetdevicesupportsthe[name]videoformatpolish.
video.
mp4ThetargetdevicesupportstheMP4videoformatDevice-SpecificVariablesComparethepreprocessingvariableinthe//#ifpreprocessingdirectivesorintheifandunlessattributesofmanyconditionalelementsofthetaskinyourbuild.
xmlfile.
Youcanalsoincludetheirvaluesinyourcodewiththe//#=directive.
Don'tforgettoAPPENDIX390checkoutallavailablepreprocessingsymbolsofyourtargetdeviceathttp://www.
j2mepolish.
org/devices-overview.
html.
Youcantestwhetheravariableisdefinedbycheckingthe[variable-name]:definedpreprocessingsymbol.
TableA-41liststhestandardpreprocessingvariables.
TableA-41.
StandardDevice-SpecificPreprocessingVariablesVariableExampleValueExplanationpolish.
BitsPerPixel16Thenumberofbitsperpixel:12are4,096colors,16are65Kcolors,etc.
polish.
CanvasHeight144TheheightofaCanvasinpixels.
polish.
CanvasSize176x144ThesizeofaCanvasin[width]x[height].
polish.
CanvasWidth176ThewidthofaCanvasinpixels.
polish.
classes.
full-screencom.
nokia.
mid.
ui.
ThefullyqualifiednameoftheFullCanvasvendor-specificfull-screenclass.
polish.
Font.
large21Theheightofthelargefont.
polish.
Font.
medium16Theheightofthemediumfont.
polish.
Font.
small15Theheightofthesmallfont.
polish.
FullCanvasHeight208TheheightinpixelsofaCanvasinfull-screenmode.
polish.
FullCanvasSize176x208Thesizein[width]x[height]ofaCanvasinfull-screenmode.
polish.
FullCanvasWidth176ThewidthinpixelsofaCanvasinfull-screenmode.
polish.
HeapSize9MBThemaximumavailableheapsize;canbedynamic.
Usethebytes()propertyfunctiontocomparethisvalue.
polish.
IdentifierNokia/6630Theidentifierofthetargetdevice.
polish.
ImageFormatpng,jpegThesupportedimageformats.
polish.
JavaConfigurationCLDC/1.
1Theconfigurationsupportedbythetargetdevice.
polish.
JavaProtocoludp,socket,Thesupportedprotocolsfortheserver-socketgenericconnectionframework.
polish.
JavaPackagemmapi,btapiAnyadditionallysupportedAPIs.
polish.
JavaPlatformMIDP/2.
0Theprofilesupportedbythetargetdevice.
polish.
Key.
ChangeInputModeKey35ThekeycodeforthekeythatchangestheinputmodeinTextFields.
polish.
Key.
ChangeNumerical35ThekeycodeforthekeythatAlphaInputModeKeyswitchesbetweenthealphabeticalandthenumericalinput.
Thisisonlydefinedwhenit'sdifferentfromtheChangeInputModeKey.
ContinuedAPPENDIX391TableA-41.
ContinuedVariableExampleValueExplanationpolish.
Key.
ClearKey-8Thekeycodefortheclearkey.
polish.
Key.
LeftSoftKey-6Thekeycodefortheleftsoftkey.
polish.
Key.
RightSoftKey-7Thekeycodefortherightsoftkey.
polish.
MaxJarSizedynamicThemaximumallowedsizeofJARfiles.
Thiscanbedynamic,inwhichcaseanysizeisallowedaslongasitfitsonthedevice.
polish.
MaxRecordStoreSize512kbThemaximumallowedsizeforrecordstores.
polish.
Name6630Thenameofthetargetdevice.
polish.
OSSymbianOS8.
0Thenameoftheusedoperatingsystem.
polish.
ScreenHeight208Theheightofthescreeninpixels.
polish.
ScreenSize176x208Thesizeofthescreenin[width]x[height].
polish.
ScreenWidth176Thewidthofthescreeninpixels.
polish.
SoundFormatmidi,amrThesupportedaudioformats.
polish.
StorageSize10MBTheavailablesizeforallapplication.
polish.
VendorNokiaThenameofthetargetdevice'svendor.
polish.
VideoFormatmp4,3gppThesupportedvideoformats.
ConfigurationVariablesJ2MEPolishallowsyoutotweakthegameengineaswellastheGUIbydefiningpreprocessingvariablesintheelementorinthemessages.
txtlocalizationfiles.
TableA-42showstheconfigurationvariables.
TableA-42.
J2MEPolishConfigurationVariablesVariableDefaultValueExplanationpolish.
animationInterval100TheintervalinmillisecondsforanimatinganyGUIelements.
polish.
ChoiceGroup.
suppressMarkCommandsfalseAmultipleListorChoiceGroupaddsthecommands"Mark"and"Unmark"bydefaulttothemenu.
Suppressthisbysettingthevariabletotrue.
APPENDIX392VariableDefaultValueExplanationpolish.
ChoiceGroup.
suppressSelectCommandfalseAnimplicitorpop-upChoiceGrouporListusuallyhavea"Select"commandthatalsocanbedeactivated.
polish.
classes.
ApplicationInitializerTheclassthatimplementsthede.
enough.
polish.
ui.
splash.
ApplicationInitializerinterface.
Whenthisvariableisset,theinterfacecanbeeasilyremovedbytheobfuscator,thussavingspace.
polish.
classes.
ImageLoaderUsuallyJ2MEPolishloadsallimagesfromtheJARfileusingtheImage.
createImage(Stringurl)method.
Thisworksfineformostsituations,butsometimesimagesshouldberetrievedfromtheRMSortheInternet.
Insuchcases,youcandefinethepolish.
classes.
ImageLoadervariable.
Thegivenclass(orstaticfieldofaclass)needstoimplementthejavax.
microedition.
lcdui.
ImageloadImage(Stringurl)throwsIOExceptionmethod,whichisresponsibleforretrievingtheimage.
polish.
command.
okOKThelabelfortheOKcommandthatisusedwhenthemenufull-screenmodeisused.
polish.
command.
cancelCancelThelabelfortheCancelcommand.
polish.
command.
selectSelectThelabelfortheSelectcommandthatisusedbyanimplicitorexclusiveListorChoiceGroup.
polish.
command.
markMarkThelabelfortheMarkcommandofamultipleListorChoiceGroup.
polish.
command.
unmarkUnmarkThelabelfortheUnmarkcommanditemofamultipleListorChoiceGroup.
polish.
command.
optionsOptionsThelabelforthecommandthatopensthelistofavailablecommands.
ContinuedAPPENDIX393TableA-42.
ContinuedVariableDefaultValueExplanationpolish.
command.
deleteDeleteThelabelfortheDeletecommandthatisusedbyTextFields.
polish.
command.
clearClearThelabelfortheClearcommandthatisusedbyTextFields.
polish.
Container.
allowCyclingtrueDefineswhethertheusercancycletothestartofalistwhenshepressesCanvas.
DOWNattheverylastelement.
polish.
DateFormatymdTheformatinwhichdatesshouldbedisplayed:anycombinationofymd,whereystandsforyear,mformonth,anddforday.
polish.
DateFormatSeparator.
Theseparatorusedfordates.
polish.
DateFormatEmptyTextYYYY.
MM.
DDThetextforshowinganulldate.
polish.
Full-screenfalseSelectivelyactivatesthefull-screenmode.
Possiblevaluesaretrue,false,andmenu.
polish.
GameCanvas.
useFull-screenYoucansetthefull-screenmodeofyourGameCanvasonMIDP1.
0devicestoeithertrue,falseormenu.
polish.
jarNameYoucandefinethepolish.
jarNamevariableforusingadifferentnamefortheproducedJARfilethandefinedinthesection.
Thismakessensewhenaspecifictargetdevicelimitsthelengthofthefilename,forexample.
polish.
MenuBar.
useExtendedMenuBarfalseWhenthisvariableissettotrue,theextendedmenubarisactivated.
polish.
skipArgumentChecktrueDefinesifmethodargumentsshouldnotbecheckedbytheJ2MEPolishGUIclasses.
Bydefault,anyincomingvaluesarecheckedforvalidity.
Youcansavesomecyclesbyskippingthosetestsinyourfinalapplication.
APPENDIX394VariableDefaultValueExplanationpolish.
ScreenChangeAnimation.
backwardThenameofthescreenchangeanimationthatshouldbeshownwhentheuserreturnsfromascreen.
ThisisdeemedtobethecasewhentheusertriggersacommandofthetypeCommand.
BACK.
Alternatively,youcanspecifyvalidJavacode,forexampletoincludeyourownanimation:.
polish.
ScreenChangeAnimation.
forwardThenameofthescreenchangeanimationthatshouldbeshownwhentheuserproceedstoanewscreen;comparethiswithbackwardanimation.
polish.
TextField.
useDirectInputfalseEnablesthedirectinputmodeofallTextFieldsandTextBoxesinyourapplication.
polish.
TextField.
suppressClearCommandfalseSetthisvariabletotruetodisableonlytheClearcommandofTextFields.
polish.
TextField.
suppressDeleteCommandfalseSetthisvariabletotruetodisableonlytheClearcommandofTextFields.
polish.
TextField.
suppressCommandsfalseYoucandeactivatetheDeleteaswellastheClearcommandsbysettingthisvariabletotrue.
polish.
TextField.
showInputInfotrueWhenthisvariableissettofalse,theindicatorofthecurrentinputmodeisnotdrawnindirectinputmodeTextFieldspolish.
TextField.
InputTimeout1000Thetimeoutinmillisecondsafterwhichachosencharacterisinsertedintothetextautomatically.
polish.
TextField.
charactersKey11Thecharactersavailablewhenthe1keyispressed.
ContinuedAPPENDIX395TableA-42.
ContinuedVariableDefaultValueExplanationpolish.
TextField.
charactersKey2abc2Thecharactersavailablewhenthe2keyispressed.
Itmightbeusefultoaddlocale-specificumlautshere.
polish.
TextField.
charactersKey3def3Thecharactersavailablewhenthe3keyispressed.
polish.
TextField.
charactersKey3ghi4Thecharactersavailablewhenthe4keyispressed.
polish.
TextField.
charactersKey5jkl5Thecharactersavailablewhenthe5keyispressed.
polish.
TextField.
charactersKey6mno6Thecharactersavailablewhenthe6keyispressed.
polish.
TextField.
charactersKey7pqrs7Thecharactersavailablewhenthe7keyispressed.
polish.
TextField.
charactersKey8tuv8Thecharactersavailablewhenthe8keyispressed.
polish.
TextField.
charactersKey9wxyz9Thecharactersavailablewhenthe9keyispressed.
polish.
TextField.
charactersKey0"0"Thecharactersavailablewhenthe0keyispressed.
OnMotoroladevices,thiskeyisusedforswitchingtheinputmode.
polish.
TextField.
charactersKeyStarThecharactersavailablewhenthestarkey(*)ispressed.
OnMotoroladevices,thiskeyisusedforenteringspaces.
polish.
TextField.
charactersKeyPoundThecharactersavailablewhenthe#keyispressed.
OnSonyEricssondevices,thiskeyisusedforenteringspaces.
polish.
TiledLayer.
useBackBufferfalseEnablesthebackbufferoptimizationfortheMIDP1.
0TiledLayerimplementation.
polish.
TiledLayer.
TransparentTileColor0x000000Setsthecolorfortransparenttileswhenthebackbufferoptimizationisenabled.
polish.
TiledLayer.
splitImagefalseSplitsthetiledimagesintosingletiles.
polish.
TiledLayer.
GridTypebyteTheprimitiveusedforstoringthegridofaTiledLayer;canbebyte,short,orint.
APPENDIX396VariableDefaultValueExplanationpolish.
title.
inputInputThetitleofthenativeTextBoxthatisnormallyusedfortheactualinputoftext.
ThistitleisusedonlywhenthecorrespondingTextFielditemhasnolabel.
WhentheTextFieldhasalabel,thatlabelisusedasatitleinstead.
polish.
usePolishGameApifalseForcestheusageoftheJ2MEPolishgameengineevenforMIDP2.
0-baseddevices.
polish.
usePolishGuitrueCanbeusedforactivatingthePolishGUIonlyforselecteddevices.
polish.
usePolishTitlefalseUsesa"J2MEPolished"titleonMIDP2.
0-baseddevicesevenwhenthefull-screenmodeisnotactive.
SymbolsandVariablesforReadingtheSettingsYoucanalsoevaluatethesetupandconfigurationofJ2MEPolishinyoursourcecode.
Thisisusefulfordifferentiatingbetweendevicesforwhichyoudon'tusetheJ2MEPolishGUIandviceversa.
TableA-43liststhepreprocessingsymbolsthataresetbyJ2MEPolish,andTableA-44liststhevariables.
TableA-43.
J2MEPolishSymbolsforReadingtheCurrentSettingVariableExplanationpolish.
debugEnabledIsdefinedwhentheloggingframeworkisactivepolish.
debug.
debugIsdefinedwhenthedebuglogginglevelisactiveforthecurrentclasspolish.
debug.
errorIsdefinedwhentheerrorlogginglevelisactiveforthecurrentclasspolish.
debug.
fatalIsdefinedwhenthefatallogginglevelisactiveforthecurrentclasspolish.
debug.
infoIsdefinedwhentheinfologginglevelisactiveforthecurrentclasspolish.
debug.
warnIsdefinedwhenthewarnlogginglevelisactiveforthecurrentclasspolish.
usePolishGuiIsdefinedwhentheJ2MEPolishGUIisusedforthecurrenttargetdeviceAPPENDIX397TableA-44.
J2MEPolishVariablesforReadingtheCurrentSettingVariableExampleValueExplanationpolish.
classes.
midlet-1com.
apress.
game.
MainMidletForeachdefinedMIDletclass,thepreprocessingvariablepolish.
classes.
midlet-isdefined.
polish.
sourceDir/home/user/ws/project/srcPointstothedirectorythatcon-tainstherootofthecurrentlyprocessedsourcecode.
PreprocessingDirectivesPreprocessingchangesthesourcecodebeforeitiscompiled.
RefertoChapter8forafulldis-cussion.
Youcanalsoincludeyourownpreprocessingdirectives;pleaseseeChapter13fordetailsonthistask.
TableA-45listsallavailabledirectives,TableA-45.
PreprocessingDirectivesDirectiveExampleExplanation#//#returntrue;Hidesastatementinsideofan#ifor#ifdefblock.
#=//#=intwidth=${polish.
FullCanvasWidth};IncludesanyAntpropertiesorpreprocessingvariablesinthefollowingcode.
#abort//#abortInvalidSetup!
Abortsthecompletebuildprocess.
Usethiswhenyouencounterinvalidsetups.
#condition//#conditionpolish.
midp2Excludesasourcefilefromthecompilationwhentheconditionisnotfulfilled.
#debug//#debugerrorForwardsthefollowingSystem.
out.
println()outputtotheloggingframework.
#define//#definetmp.
MySymbolDefinesatemporarypreprocessingsymbolorvariable.
#elif//#elifpolish.
midp2&&polish.
api.
3dBrancheswithinan#ifor#ifdefdirectivebycheckingapreprocessingterm.
#elifdef//#elifdefpolish.
midp2Brancheswithinan#ifor#ifdefdirectivebycheckingforasinglesymbol.
#elifndef//#elifndefpolish.
midp2Brancheswithinan#ifor#ifdefdirectivebycheckingforasinglesymbolthatshouldnotbedefined.
#else//#elseBrancheswithinan#ifor#ifdefdirective.
APPENDIX398DirectiveExampleExplanation#endif//#endifClosesan#ifor#ifdefdirective.
#foreach//#foreachformatinpolish.
SoundFormatEvaluatesseveralvaluesofonepreprocessingvariableindividually.
#if//#ifpolish.
midp2&&polish.
api.
3dTestsapreprocessingtermorasinglesymbol.
#ifdef//#ifdefpolish.
midp2Checksforasinglesymbol.
#ifndef//#ifndefpolish.
midp2Checksforasinglesymbolthatshouldnotbedefined.
#include//#include${polish.
source}/code.
txtIncludesthedefinedfile.
Usethe${polish.
sourceDir}propertyfortherootofthesourcetree.
#message//#messageit'snice!
Printsamessageduringthebuildprocess.
#next//#nextformatEndsa#foreachblock.
#style//#styleMainMenuAppliesaCSSstyletothefollowingitemorscreen.
#todo//#todoimplementthiscase!
Printsamessageduringthebuildprocessthatincludesthesourcefileandlinenumber.
#undefine//#undefinetmp.
MySymbolUndefinesatemporarypre-processingsymbolorvariable.
Thisdirectiveisusuallynotneededsincetheseareunde-finedautomaticallywhenanewsourcefileisprocessed.
PropertyFunctionsJ2MEPolishprovidesasetofpropertyfunctionsfortransformingvariablevaluesinprepro-cessingstatementsandwithinanyattributesofthetask.
SeeChapter8forafulldiscussionofpropertyfunctions.
TableA-46liststheavailablepropertyfunctions.
TableA-46.
FunctionsforTransformingVariableValuesFunctionPurposebytesCalculatesthenumberofbytesofthegivenmemoryvalue(e.
g.
,1kbbecomes1024).
Thememoryvaluedynamicreturns-1.
classnameRetrievesthefullyqualifiednameforthegivenclass.
WhenyouactivatetheuseDefaultPackageoptionoftheelement,allsourcefileswillbemovedintotheemptydefaultpackage.
Inthatcase,${classname(com.
apress.
ImageLoader)}returnsImageLoader.
WhentheuseDefaultPackageoptionisnotactiveortheobfuscatorisnotenabled,thefunctionreturnscom.
apress.
ImageLoader.
ContinuedAPPENDIX399TableA-46.
ContinuedFunctionPurposegigabytesCalculatesthe(double)numberofgigabytesofthegivenmemoryvalue.
kilobytesCalculatesthe(double)numberofkilobytesofthegivenmemoryvalue.
Thevaluecancontainapointanddecimalplaces(e.
g.
,512bytesbecomes0.
5,1024bytesbecomes1,etc.
).
lowercaseTranslatesthegivenvalueintolowercase(e.
g.
,AbCbecomesabc).
megabytesCalculatesthe(double)numberofmegabytesofthegivenmemoryvalue.
nospaceReplacesanyspaceswithunderscores(e.
g.
,${nospace(polish.
name)}becomesOne_Touch_756whenprocessingAlcatel'sOneTouch756phone).
numberRetrievesthenumberofseparatevalueswithinthevariable.
uppercaseTranslatesthegivenvalueintouppercase(e.
g.
,aBcbecomesABC).
TheJ2MEPolishGUIYoucandeploydifferentbackgroundandbordersforyourItemsandScreensbyusingthebackground-typeandborder-typeCSSattributes.
Dependingontheactualtype,youcanuseadditionalattributesforadjustingthebackgroundandborder.
BackgroundsYoucanplacebackgroundsforItemsaswellScreens.
TheJ2MEPolishGUIprovidesseveralpossiblebackgrounds,rangingfromsimple,mono-coloredbackgroundstoanimated,pulsat-ingbackgrounds.
Thissectiondescribeseachavailablebackgroundindetail.
simpleBackgroundThesimplebackgroundjustfillsthebackgroundwithonecolor.
Whennobackgroundtypeisspecified,thesimplebackgroundisusedbydefault,unlessthebackground-imageattributeisset.
Inthatcase,theimagebackgroundwillbeusedinsteadbydefault.
TableA-47liststheattributesofthesimplebackground,ListingA-10demonstratestheuseofthebackground,andFigureA-1displaysanexampleofthebackground.
TableA-47.
AttributesofthesimpleBackgroundAttributeRequiredExplanationtypeNoThetypecanbesimplecolorYesThecolorofthebackground;eitherthenameofthecolororadirectdefinition.
Thesimplebackgroundsupportscolorswithalphavaluesaswell.
APPENDIX400ListingA-10.
UsingaTranslucentBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background-color:argb(128,238,241,229);border{width:2;color:fontColor;}layout:expand|center;}FigureA-1.
Usingatranslucentsimplebackgroundforthecurrentlyfocuseditemround-rectBackgroundTheround-rectbackgroundpaintsarectangularbackgroundwithroundedges.
TableA-48liststheattributesoftheround-rectbackground,ListingA-11demonstratestheuseofthebackground,andFigureA-2displaysanexampleofthebackground.
TableA-48.
Attributesoftheround-rectBackgroundAttributeRequiredExplanationtypeYesThetypehastoberound-rectorroundrect.
colorNoThecolorofthebackground;eitherthenameofthecolororadirectdefinition.
Thedefaultcoloriswhite.
arcNoThediameterofthearcatthefourcorners.
Thedefaultis10pixelswhennoneisspecified.
arc-widthNoThehorizontaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
arc-heightNoTheverticaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
APPENDIX401ListingA-11.
Usingaround-rectBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{type:round-rect;color:white;arc:18;}layout:expand|center;}FigureA-2.
Usingaround-rectbackgroundforthecurrentlyfocuseditemimageBackgroundTheimagebackgroundusesanimageforpaintingthebackground.
Thisbackgroundtypeisusedbydefaultwhennotypeissetandthebackground-imageattributeisset.
TableA-49liststheattributesoftheimagebackground,ListingA-12demonstratestheuseofthebackground,andFigureA-3displaysanexampleofthebackground.
TableA-49.
AttributesoftheimageBackgroundAttributeRequiredExplanationtypeNoWhenused,needstobeimage.
colorNoThecolorofthebackground;eitherthenameofthecolor,adirectdefinition,ortransparent.
Thedefaultcoloriswhite.
Thiscolorisvisibleonlywhentheimageisnotsmallerthantheactualbackground.
imageYesTheURLoftheimage(e.
g.
,url(background.
png)).
APPENDIX402AttributeRequiredExplanationanchorNoTheanchoroftheimage.
Whenthisisnotspecified,theimagewillbecentered(horizontal-center|vertical-center).
Youcanuseacombinationoftop,vertical-center(=vcenter),bottomandleft,horizontal-center(=hcenter=center),andright:anchor:top|left;.
repeatNoEitherrepeat,no-repeat,repeat-x,orrepeat-y.
Thisattributedetermineswhetherthebackgroundshouldberepeated,repeatedhorizontally,orrepeatedvertically.
Thedefaultisno-repeat.
ListingA-12.
UsinganimageBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{image:url(gradient.
png);color:transparent;anchor:top|center;}layout:expand|center;}FigureA-3.
UsingagradientimageasthebackgroundforthecurrentlyfocuseditemcircleBackgroundThecirclebackgroundpaintsacircularorellipticalbackground.
TableA-50liststheattrib-utesofthecirclebackground,ListingA-13demonstratestheuseofthebackground,andFigureA-4displaysanexampleofthebackground.
APPENDIX403TableA-50.
AttributesofthecircleBackgroundAttributeRequiredExplanationtypeNoThetypeneedstobecircle.
colorNoThecolorofthebackground;eitherthenameofthecolororadirectdefinition.
Thedefaultcoloriswhite.
diameterNoByusingthediameterattribute,youcanensurethatalwaysacircleandneveranellipseispainted.
Thediameterthendefinesthediameterofthecirclethatisused,regardlessoftheactualdimensionsofthebackground.
ListingA-13.
UsingthecircleBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{type:circle;diameter:70;color:white;}layout:expand|center;}FigureA-4.
UsingacirclebackgroundforthecurrentlyfocuseditempulsatingBackgroundThepulsatingbackgroundanimatesthecolorofthebackground.
Thecolorchangesfromastartcolortoanendcolor.
TableA-51liststheattributesofthepulsatingbackground,ListingA-14demonstratestheuseofthebackground,andFigureA-5displaysanexampleofthebackground.
APPENDIX404TableA-51.
AttributesofthepulsatingBackgroundAttributeRequiredExplanationtypeNoThetypeneedstobepulsating.
start-colorYesThecolorofthebackgroundatthebeginningoftheanimationsequence.
end-colorYesThecolorofthebackgroundattheendoftheanimationsequence.
stepsYesDefineshowmanycolorshadesbetweenthestartcolorandtheendcolorshouldbeused.
repeatNoEitheryes/trueorno/false;determineswhethertheanimationshouldberepeated.
Thedefaultisyes.
back-and-forthNoEitheryes/trueorno/false;determineswhethertheanima-tionsequenceshouldberunningbackwardtothestartcoloragain,afteritreachestheendcolor.
Whennoisselected,theanimationwilljumpfromtheendcolordirectlytothestartcolor(whenrepeatisenabled).
Thedefaultisyes.
ListingA-14.
UsingthepulsatingBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{type:pulsating;start-color:highlightedBackgroundColor;end-color:white;back-and-forth:no;repeat:no;}layout:expand|center;}FigureA-5.
Thepulsatingbackgroundinaction:ontheleftsideshortlyafterthestartofthesequenceandontherightsideattheendAPPENDIX405pulsating-circleBackgroundThepulsating-circlebackgroundpaintsacircularbackgroundwhosesizeconstantlyincreasesanddecreases.
TableA-52liststheattributesofthepulsating-circlebackground,ListingA-15demonstratestheuseofthebackground,andFigureA-6displaysanexampleofthebackground.
TableA-52.
Attributesofthepulsating-circleBackgroundAttributeRequiredExplanationtypeNoThetypeneedstobepulsating-circle.
colorNoThecolorofthebackground;eitherthenameofthecolororadirectdefinition.
Thedefaultiswhite.
min-diameterYesTheminimumdiameterofthecircle.
max-diameterYesThemaximumdiameterofthecircle.
ListingA-15.
UsingthepulsatingcircleBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{type:pulsating-circle;color:white;min-diameter:20;max-diameter:75;}layout:expand|center;}FigureA-6.
Thepulsating-circlebackgroundinaction:ontheleftsideatthestartofthesequenceandontherightsideattheendAPPENDIX406pulsating-circlesBackgroundThepulsating-circlesbackgroundpaintsananimatedbackgroundofever-growingcirclesthathavedifferentcolors.
TableA-53liststheattributesofthepulsating-circlesbackground,ListingA-16demonstratestheuseofthebackground,andFigureA-7displaysanexampleofthebackground.
TableA-53.
Attributesofthepulsating-circlesBackgroundAttributeRequiredExplanationtypeNoThetypeneedstobepulsating-circles.
first-colorYesThefirstcirclecolor;eitherthenameofthecolororadirectdefinition.
second-colorYesThesecondcirclecolor;eitherthenameofthecolororadirectdefinition.
min-diameterYesTheminimumdiameterofthecircle.
max-diameterYesThemaximumdiameterofthecircle.
circles-numberYesThenumberofcirclesthatshouldbepainted.
stepNoThenumberofpixelseachcircleshouldgrowineachani-mationphase.
Floatvalueslike1.
5arealsoallowed,evenwhenyoutargetaCLDC1.
0device.
Thisdefaultsto1pixel.
ListingA-16.
Usingthepulsating-circlesBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{type:pulsating-circles;first-color:white;second-color:highlightedBackgroundColor;circles-number:7;min-diameter:10;max-diameter:100;}layout:expand|center;}APPENDIX407FigureA-7.
Thepulsating-circlesbackgroundinactionopeningBackgroundTheopeningbackgroundpaintsananimatedbackgroundthatstartsatalowheightandthenincreasesitsheightwheneveritchangesposition.
Itsprimaryuseisforthefocusedstyle.
TableA-54liststheattributesoftheopeningbackground,ListingA-17demonstratestheuseofthebackground,andFigureA-8displaysanexampleofthebackground.
TableA-54.
AttributesoftheopeningBackgroundAttributeRequiredExplanationtypeNoThetypeneedstobeopening.
colorYesThebackgroundcolor;eitherthenameofthecolororadirectdefinition.
start-heightNoTheheightofthebackgroundimmediatelyafterithaschangedposition.
Thisdefaultsto1pixel.
stepsNoThenumberofpixelsbywhichtheheightshouldbeincreasedineachanimationstep.
Thisdefaultsto4pixels.
Whentheheightisthesameasthenormalbackground,theanimationstops.
ListingA-17.
UsingtheopeningBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{type:opening;color:white;start-height:6;steps:2;}layout:expand|center;}APPENDIX408FigureA-8.
Theopeningbackgroundinaction:ontheleftshortlyafterswitchingthefocuseditemandontherightsideafterremainingawhileonthefocuseditemopening-round-rectBackgroundTheopening-round-rectbackgroundpaintsananimatedbackgroundwhoseheightstartssmallandthenincreaseswheneveritchangesposition.
Itsprimaryuseisforthefocused-style.
TableA-55liststheattributesoftheopening-round-rectbackground,ListingA-18demon-stratestheuseofthebackground,andFigureA-9displaysanexampleofthebackground.
TableA-55.
Attributesoftheopening-round-rectBackgroundAttributeRequiredExplanationtypeNoThetypeneedstobeopening-round-rect.
colorYesThebackgroundcolor;eitherthenameofthecolororadirectdefinition.
start-heightNoTheheightofthebackgroundimmediatelyafterithaschangeditsposition.
Thisdefaultsto1pixel.
stepsNoThenumberofpixelsbywhichtheheightshouldbeincreasedineachanimationstep.
Thisdefaultsto4pixels.
Whentheheightisthesameasthenormalbackgroundheight,theanimationisstopped.
border-widthNoThewidthoftheborder.
Thedefaultis0(noborder).
border-colorNoThecoloroftheborder.
Thedefaultisblack.
arcNoThediameterofthearcatthefourcorners.
Thedefaultis10pixelswhennoneisspecified.
arc-widthNoThehorizontaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
arc-heightNoTheverticaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
APPENDIX409ListingA-18.
Usingtheopening-round-rectBackgroundfortheCurrentlyFocusedItemfocused{padding:9;font-color:highlightedFontColor;background{type:opening-round-rect;color:white;start-height:0;steps:2;border-width:2;border-color:fontColor;arc:18;}layout:expand|center;}FigureA-9.
Theopening-round-rectbackgroundinaction:ontheleftshortlyafterswitchingthefocuseditem,andontherightsideafterremainingawhileonthefocuseditemround-tabBackgroundTheround-tabbackgroundpaintsarectangularbackgroundwherethetopedgesarerounded.
ItsmainuseisforTabbedForms(compareChapter12).
TableA-56liststheattributesoftheround-tabbackground,ListingA-19demonstratestheuseofthebackground,andFigureA-10displaysanexampleofthebackground.
TableA-56.
Attributesoftheround-tabBackgroundAttributeRequiredExplanationtypeYesThetypeneedstoberound-tab.
colorNoThecolorofthebackground;eitherthenameofthecolororadirectdefinition.
Thedefaultcoloriswhite.
arcNoThediameterofthearcatthefourcorners.
Thedefaultis10pixelswhennoneisspecified.
APPENDIX410AttributeRequiredExplanationarc-widthNoThehorizontaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
arc-heightNoTheverticaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
ListingA-19.
Usingtheround-tabBackgroundinaTabbedFormtabbar{background-color:white;layout:expand;padding-bottom:0;tabbar-scrolling-indicator-color:black;}activetab{background-type:round-tab;background-color:silver;background-arc:8;font-color:white;padding-left:10;padding-right:8;}inactivetab{padding-left:6;padding-right:4;margin-left:2;margin-right:2;background-type:round-tab;background-color:gray;background-arc:8;font-color:silver;}FigureA-10.
Theround-tabbackgroundinaTabbedFormAPPENDIX411BordersYoucansetbordersforanyItems.
TheJ2MEPolishGUIprovidesseveralpossibleborders,whicharedescribedinthissection.
simpleBorderThesimpleborderpaintsarectangleborderinonecolor.
Thetypeattributedoesnotneedtobesetforthesimpleborder,sincethisisthedefaultborder.
TableA-57liststheattributesofthesimpleborder,ListingA-20demonstratestheuseoftheborder,andFigureA-11displaysanexampleoftheborder.
TableA-57.
AttributesofthesimpleBorderAttributeRequiredExplanationcolorYesThecoloroftheborder;eitherthenameofthecolororadirectdefinition.
widthNoThewidthoftheborderinpixels.
Thedefaultis1.
ListingA-20.
UsingasimpleBorderfortheCurrentlyFocusedItemfocused{font-color:highlightedFontColor;background:none;border-width:2;border-color:black;layout:expand|center;}FigureA-11.
UsingasimpleborderforthecurrentlyfocuseditemAPPENDIX412round-rectBorderTheround-rectborderpaintsarectangularborderwithroundedges.
TableA-58liststheattributesoftheround-rectborder,ListingA-21demonstratestheuseoftheborder,andFigureA-12displaysanexampleoftheborder.
TableA-58.
Attributesoftheround-rectBorderAttributeRequiredExplanationtypeYesThetypeneedstoberound-rectorroundrect.
colorYesThecoloroftheborder;eitherthenameofthecolororadirectdefinition.
widthNoThewidthoftheborderinpixels.
Thedefaultis1.
arcNoThediameterofthearcatthefourcorners.
Thedefaultis10pixelswhennoneisspecified.
arc-widthNoThehorizontaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
arc-heightNoTheverticaldiameterofthearcatthefourcorners.
Thedefaultisthearcvaluewhennoneisspecified.
ListingA-21.
Usingaround-rectBorderfortheCurrentlyFocusedItemfocused{font-color:highlightedFontColor;background:none;border{type:round-rect;width:2;color:black;arc:18;}layout:expand|center;}FigureA-12.
Usingaround-rectborderforthecurrentlyfocuseditemAPPENDIX413shadowBorderTheshadowborderpaintsashadowyborder.
TableA-59liststheattributesoftheshadowbor-der,ListingA-22demonstratestheuseoftheborder,andFigureA-13displaysanexampleoftheborder.
TableA-59.
AttributesoftheshadowBorderAttributeRequiredExplanationtypeYesThetypeneedstobeshadow,bottom-right-shadow,orright-bottom-shadow.
colorYesThecoloroftheborder,eitherthenameofthecolororadirectdefinition.
widthNoThewidthoftheborderinpixels.
Thedefaultis1.
offsetNoTheoffsetbetweenthecornerandthestartoftheshadow.
Thedefaultis1pixel.
ListingA-22.
UsingashadowBorderfortheCurrentlyFocusedItemfocused{font-color:highlightedFontColor;background-color:highlightedBackgroundColor;border{type:shadow;width:2;color:black;offset:5;}layout:expand|center;}FigureA-13.
UsingashadowborderandasimplebackgroundforthecurrentlyfocuseditemAPPENDIX414top,bottom,left,andrightBordersTheseborderspaintasimpleborderononesideofthecorrespondingitem.
TableA-60liststheattributesoftheborders,ListingA-23demonstratestheuseofthebottomborder,andFigureA-14displaysanexampleofthebottomborder.
TableA-60.
Attributesofthetop,bottom,left,andrightBordersAttributeRequiredExplanationtypeYesThetypeneedstobetop,bottom,left,orrightcolorYesThecoloroftheborder;eitherthenameofthecolororadirectdefinitionwidthNoThewidthoftheborderinpixels.
Thedefaultis1.
ListingA-23.
UsingabottomBorderfortheCurrentlyFocusedItemfocused{font-color:highlightedFontColor;background-color:highlightedBackgroundColor;border{type:bottom;width:2;color:black;}layout:expand|center;}FigureA-14.
UsingabottomborderforthecurrentlyfocuseditemAPPENDIX415circleBorderThecircleborderpaintsaroundorellipticalborder.
TableA-61liststheattributesofthecircleborder,ListingA-24demonstratestheuseoftheborder,andFigureA-15displaysanexampleoftheborder.
TableA-61.
AttributesofthecircleBorderAttributeRequiredExplanationtypeYesThetypeneedstobecircle.
colorYesThecoloroftheborder,eitherthenameofthecolororadirectdefinition.
widthNoThewidthoftheborderinpixels.
Thedefaultis1.
stroke-styleNoEithersolidordotted.
Itdefinesthepaintingstyleoftheborderandthedefaultissolid.
ListingA-24.
UsingacircleBorderfortheCurrentlyFocusedItemfocused{font-color:highlightedFontColor;background-color:highlightedBackgroundColor;border{type:circle;width:2;color:black;stroke-style:dotted;}layout:expand|center;}FigureA-15.
UsingadottedcircleborderforthecurrentlyfocuseditemAPPENDIX416J2MEPolishLicenseJ2MEPolishislicensedundertheopensourceGNUGeneralPublicLicense(GPL,http://www.
gnu.
org/licenses/gpl.
html)aswellasaproprietarylicense(http://www.
j2mepolish.
org/licenses.
html).
Youcanusethecompletebuildfeaturesalongwiththedevicedatabaseinyourcommercial,closed-sourceapplication,withoutanyrestrictions,forfree.
IfyouwanttousepartsofJ2MEPolishthatarelinkedwithyourapplication,suchastheutilityclasses,theGUI,orthegameengine,youneedtoeitherpublishyourapplicationundertheGPLorobtainacommerciallicense.
Fordetailsandpricing,pleaserefertohttp://www.
j2mepolish.
org/licenses.
html.
AbbreviationsGlossaryInthewirelessJavaworldyouwillencountermanyacronyms;someofthesearelistedinTableA-62.
TableA-62.
AbbreviationsandAcronymsintheWirelessJavaWorldAbbreviationExplanation3GThirdGeneration.
AtermdescribingUMTSandsimilaradvancednetworktechnologies.
3GPPThirdGenerationPartnershipProject.
Aworldwidecollaborationprojectestablishedin1998tocreateandstandardizeadvancednetworktechnologies(http://www.
3gpp.
org).
AMSApplicationManagementSoftware.
Softwareresponsibleforinstallingandrunningtheapplicationandforforwardingeventstotheapplication.
CBSCellBroadcastService.
AGSMserviceforsendingmessagestoalldevicesreachablefromacertaincelloragroupofcells.
CDCConnectedDeviceConfiguration.
AconfigurationthatprovidesanenvironmentsimilarJ2SE.
CLDCConnectedLimitedDeviceConfiguration.
ThecommonJ2MEconfigurationdefiningtheminimalrequirementsforaJ2MEdevice.
TheCLDC1.
1releaseintroducedfloating-pointcalculationsandweakreferencestotheJ2MEworld.
CSSCascadingStyleSheets.
ThestandardtodesignwebsitesandnowalsoJ2MEapplications.
GCFGenericConnectionFramework.
AframeworkthatprovidesanabstractsystemforestablishingI/Oconnectionstoarbitrarydatastreams.
GUIGraphicaluserinterface.
Theapplicationcomponentsvisibletotheuser.
IMEIInternationalMobileEquipmentIdentity.
Agloballyuniqueidentificationnumberofthemobiledevice.
IMPInformationModuleProfile.
Aprofileforembeddeddevices.
Basically,it'sMIDPwithouttheuserinterface.
IMSIInternationalMobileSubscriberIdentity.
Theidentificationnumberofthesubscribertoacarriernetwork.
TheIMSIisstoredontheSIMcard.
J2EEJava2EnterpriseEdition.
Aruntimeenvironmentforserverapplications(http://java.
sun.
com/j2ee).
ContinuedAPPENDIX417TableA-62.
ContinuedAbbreviationExplanationJ2MEJava2MicroEdition.
Aruntimeenvironmentforrestricteddevices(http://java.
sun.
com/j2me).
J2SEJava2StandardEdition.
Aruntimeenvironmentfordesktopapplications(http://java.
sun.
com/j2se).
JADJavaApplicationDescriptor.
AtextfilecontaininginformationabouttheapplicationthatitselfisintheJARfile.
TheJADfilecanallowsthedevicetochecktherequirementslistedintheJADbeforethe(muchbigger)JARfileisdownloaded.
JAMJavaApplicationManager.
AnothernamefortheAMS.
JARJavaARchive.
AZIPfilethatincludesJavaclasses,resources,andaManifest.
JCPJavaCommunityProcess.
ResponsibleforcreatingJava-basedstandards(http://www.
jcp.
org)JSRJavaSpecificationProcess.
AstandardizationrequestwithintheJCP.
JTWIJavaTechnologyfortheWirelessIndustry.
AstandardthattriestolimitdevicefragmentationbysettingminimumrequirementsforJ2MEdevices(JSR185).
JVMJavaVirtualMachine.
Astandardizedmachineusuallyrealizedinsoftware.
KVMKilobyteVirtualMachine.
ThenameoftheJVMfortheConnectedLimitedDeviceConfiguration.
OriginallyKstandsforKuaui,butnowitstandsforkilo,asinkilobyte,toemphasizeitssmallsize.
MIDletAnapplicationwrittenfortheMIDPprofile.
MIDPMobileInformationDeviceProfile.
Aprofilethataddsbasicnetworking,userinterface,andpersistencefunctionalitytotheCLDC.
MMSMultimediaMessageService.
AGSMserviceforsendingenhancedtextmessagesthatcancontainmultimediaelementssuchaphotosorsounds.
SomedevicesacceptJavaapplicationstobedeployedviaMMS.
OTAOverTheAir(Provisioning).
AspecificationfordownloadingandinstallingJ2MEapplicationoverawirelessnetwork.
PIMPersonalInformationManager.
Softwareformanagingpersonalinformationsuchasaddressbooks,calendars,to-dolists,andsoon.
PNGPortableNetworkGraphics.
Thedefault,patent-freeformatforimagesonJ2MEdevices.
RMSRecordManagementSystem.
ApersistencemechanismofferedbytheMIDPandIMPprofiles.
SIMSubscriberIdentityModule.
TheSIMcardisusedtoidentifythemobilephoneownertothenetwork.
TheSIMcardcontainstheIMSI.
SMSShortMessageService.
AGSMserviceforsendingshorttextorbinarymessagestodevices.
UMTSUniversalMobileTelephoneSystem.
OneoftheThirdGeneration(3G)mobilesystems.
WAPWirelessApplicationProtocol.
Anetworkagnosticprotocolforwirelessconnections.
IsoftenusedtodownloadJ2MEapplicationsandformsthebasisforsendingMMSmessages.
WMLWirelessMarkupLanguage.
AnXML-basedmarkuplanguageforstructuringcontentforWAPbrowsers.
APPENDIX418Symbols!
operatorseenot(!
)operator#xyzpreprocessingdirectivesseepreprocessingdirectives&&operatorseeand(&&)operator=directiveseeequals(#=)directive^(xor)operator,107||(or)operator,107Numbers3DGraphicsAPI,359–3603GPP(ThirdGenerationPartnershipProject),4173gppgroupassemblingresources,7155/65/75groupsSiemensdevices,2897-Zippackager,15,79parameters,385using,79Aaselector,StringItem,186abbreviationsglossary,417abortdirective,398abstractclassesdesignphase,31abstractionhigh-levelperformancetuning,330accessmodifierslow-levelperformancetuning,338acronymsglossary,417activetabstyledesigningTabbedForms,213predefinedstyles,184addressbookmanagingcontactsin,134afterattributecommondesignattributes,CSS,197–198structureofstyledefinition,189AHNAPI(AdHocNetworkingAPI)optionalpackagesforMIDPdevices,278algorithmshigh-levelperformancetuning,334allowCyclingvariable,Container,394alphablendingcolors,195amrgroupassemblingresources,71AMR'sJazelleMIDPplatforms,293AMS(ApplicationManagementSoftware),417detectinginterruptions,320anchorattributeimagebackground,403and(&&)operator,73,107andnestedelementdeviceRequirementselement,365animatemethodBorderclassusing,269creatingclient-sideBackgroundclass,265animationIntervalvariable,164,392SpriteItemconstructorarguments,179animationsdesigningTickers,227–228programmingSpriteItem,178repeat-animationattribute,208,209screen-change-animationattribute,229using,228–229Ant,9,55–58build.
xmlelements,363–389buildsection,366–369compilerelement,373–375compilerargselement,375,376copierelement,383–384debugelement,371–372deviceRequirementssection,365emulatorelement,388filesetelement,382filterelement,371–372finalizerelement,387handlerelement,372infosection,363–364jadelement,385–386jadFilterelement,386keepelement,377–378localizationelement,382–383manifestFilterelement,386midletelement,369–370midletselement,369–370obfuscatorelement,377packagerelement,384–385parameterelement,emulator,389parameterelement,obfuscator,378postcompilerelement,376–377preprocessorelement,372–373preverifierelement,380–381resourceselement,381–382signelement,387sourceelement,369sourceselement,369variableelement,370–371variableselement,370–371Index419build.
xmlfile,55properties,56creating"HelloWorld"application,58–64determiningnameofpropertiesfile,57integratingEclipseIDEwith,20–21J2MEPolishAntsettings,363–389onlinedocumentationfor,56onlinelistofexternaltasks,56properties,56activating/deactivatingloggingframework,127loading,57settingAntproperties,238write-oncecapability,57targetdependencies,58targets,55copyingresources,246extendingbuildphases,237usingcustompackagers,246tasks,55antcalladditionalAntpropertiesforobfuscator,245implementingcustompreverifier,245integratingfinalizers,247integratingunsupportedobfuscators,96postcompiler,244usingcustompreprocessor,243anti-aliasingusingforbitmapfont,142ApacheAntseeAntapielement,apis.
xml,45apiDirattribute,buildelement,366APIscontrollingvibrationanddisplaylight,156designphase,31devicecontrol,156device-specificpreprocessingsymbols,390integratingbinarythird-partyAPIs,93integratingdeviceAPIs,94integratingsourcecodethird-partyAPIs,92integratingthird-partyAPIs,92–94optionalpackagesforMIDPdevices,276–278portinglow-levelgraphicsoperations,152portingsoundplayback,155Series80Nokiadevices,287apisattribute,buildelement,366apiselement,apis.
xml,45apis.
xml,45–47devicedatabasefile,39specifyinglibrariesin,46Aplix'sJBlendJVMMIDPplatforms,293appendmethod,FormclassadditionalFramedFormmethods,177additionalTabbedFormmethods,174designingChoiceGroups,216integratingCSSintocustomitems,256applicationbundlespecifyingfilesnottoincludein,70applicationlifecycle,30buildphase,31–32,64–68deploymentphase,31,33designphase,30–31implementationphase,30,32optimizationphase,31,33testingphase,31–32updatingapplication,36ApplicationInitializervariable,393applicationsbuildinglocalizedapplications,84configuringapplication,74debuggingapplications,96–99obfuscatingapplications,94–96optimizingapplicationsseeoptimizingapplicationsuntrustedapplications,77appliesToattributeregisteringcustomCSSattributes,260arcattributeopening-round-rectbackground,409round-rectbackground,401round-rectborder,413round-tabbackground,410arc-heightattributeopening-round-rectbackground,409round-rectbackground,401round-rectborder,413round-tabbackground,411arc-widthattributeopening-round-rectbackground,409round-rectbackground,401round-rectborder,413round-tabbackground,411architecturedesignphase,31high-levelperformancetuning,330–331optimizationphase,33areaelement,bugs.
xml,47argumentsskipArgumentChecksymbol,164argumentsattribute,packagerelement,384usingthird-partypackagers,78arithmeticoperationslow-levelperformancetuning,336arraydatabytecodeinstructionstoringintegerarray,346loadingarraydatafromresourcefile,348storingarraydatainstrings,347storingtoimproveclassmodel,345–348arrayCopymethod,Systemclasslow-levelperformancetuning,335ArrayListclass,134–135low-levelperformancetuning,335synchronization,134arrayssplittingtextintoStringarray,135ASCII-StringdatatypeBinaryEditor,141INDEX420aspect-orientedprogrammingJ2MEapps.
onmultipledevices,102preprocessing,300asteriskattributenameendingwith,76AT&TWirelesscarriermodifications,292attribute-valuepairsCSSdeclaration,187attributesdesignattributes,189–199grouping,CSS,187nameendingwithasterisk,76nameendingwithquestionmark,76optionalattributes,76overridingattributevalues,74registeringcustomCSSattributes,259selectingallremaining,76selectingseveral,76specifying,74audiodevice-specificpreprocessingsymbols,390audio.
xyzpropertiessystemproperties,357authenticationhigh-levelperformancetuning,332HTTPnetworking,312automaticresourceassemblingdevicedatabase,49availablemethod,InputStreamdefensiveprogramming,304Bbackbufferoptimizationoptimizinggameengine,148–149back-and-forthattributepulsatingbackground,405backgroundattributestructureofstyledefinition,189Backgroundclassclient-side,265–267server-side,267–268background-colorattributepop-upChoiceGroups,221background-typeattribute,199backgroundsbackgroundconverter,267circlebackground,403–404creatingBackgroundclassclient-side,265–267server-side,267–268creatingcustom,265–269custombackground,268–269designingscreenbackground,199designing,CSS,199imagebackground,402–403movingbackground,265usinginpolish.
cssfile,268notrequired,198openingbackground,408–409opening-round-rectbackground,409–410pulsatingbackground,404–405pulsating-circlebackground,406pulsating-circlesbackground,407–408round-rectbackground,401–402round-tabbackground,410–411simplebackground,400–401translucentbackgroundscurrentlyfocuseditem,401portinglow-levelgraphics,153backgroundssection,polish.
cssfile,189Backlightfunctionalitydevicecontrol,156backwardvariable,ScreenChangeAnimation,395beforeattribute,189,197–198behavior,configuringGUI,164–167benchmarkingtests,328,329binfolder,15MacOSXsystem,139binarydatafilescreating/manipulating,138managinglevelfiles,139BinaryEditor,139–141editingdatawith,140predefinedtypesof,141binaryLibraryattribute,buildelement,366bitmapattribute,196bitmapfonts,142commondesignattributes,CSS,197BitMapFontclass,136–138customizingfonts,133BitMapFontViewerclassdisplayingmessages,136layoutmethod,137paintmethod,137BitsPerColorgroupsassemblingresources,71BitsPerPixel391devicedatabase,42preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,82BlackBerryseeRIMBlackBerryblocksplitparameterKZIPpackager,80,385BluetoothAPIdeploymentphase,33deviceidentification,319networkingproblems,310permissionsforsignedMIDlets,361properties,358–359Series40/60Nokiadevices,286booleandatatypeBinaryEditor,141booleanoperatorsevaluatingterms,107bootclasspathattributecompilerelement,373bootclasspathrefattributecompilerelement,373borderattribute,189Borderclass,269INDEX421border-colorattribute,409border-typeattribute,199border-widthattribute,409bordersaddingcustomborders,269circleborder,416designing,CSS,199notrequired,198round-rectborder,413shadowborder,414simpleborder,412top,bottom,left,andrightborders,415borderssection,polish.
cssfile,189bottomanimation,229bottomborder,415bottomlayout,193bottomframestyle,185boxmodelCSSboxmodel,191–192branchingcodeifdirective,105BREW(BinaryRuntimeEnvironmentforWireless),293bugelement,bugs.
xml,47bugsoptimizationphase,33preprocessingsymbolsandvariables,115Bugscapabilitydevicedatabase,43bugselement,bugs.
xml,47bugs.
xml,47–48clarifyingdevicebugsin,47devicedatabasefile,39buildelement,build.
xmlattributes,tableof,366,368buildingaMIDletwithJ2MEPolish,61buildextensions,231–248acceptingparametersin,233Anttargets,invoking,237–238buildphasessummarized,231–232compiler,changing/configuring,243–244configuring,233–235configuringextensionwithconditionalparameters,234creatingcustompreprocessor,239–243emulators,integrating,247–248extensionmechanism,231–238Extensionsuperclass,232finalizers,integrating,247obfuscator,integratingcustom/third-party,244–245packagers,usingcustom,246parameterelements,233postcompiler,using,244Preprocessorclass,implementing,239–243preverifier,integrating,245propertyfunctions,creating,248registeringextensions,235,236resources,copyingandtransforming,245–246usingextensions,237usingextensionsconditionally,236usinginbuild.
xmlfile,235–236buildframework,30buildphase,64–68applicationlifecycle,31–32buildingformultipledevices,80–84buildinglocalizedapplications,84–91compilationphase,66–67extendingseebuildextensionsextensionpointsof,232invokingemulators,68minimizingnumberoftargetdevices,83–84obfuscationphase,67packagingphase,68–80managingJADandManifestattributes,74–77resourceassembling,68–73signingMIDlets,77–78usingthird-partypackagers,78–80preprocessingphase,66preverificationphase,68selectingdevicestobuildfor,80–83selectingtargetdevices,65–66summarized,231–232buildsection,build.
xml,366–369buildtoolsAnt,55–58extendingbuildphasesseebuildextensionsMake,55build.
xmlfile,16activatingspecificloglevels,124activatingtheGUI,161–162activating/deactivatingloggingframework,128Ant,55Antproperties,56buildingaMIDlet,60configuringbuildextensions,233–235configuringGUI,162–170controllingloggingframework,125controllingGUI,161–170creatinga"polished"application,161debuggingapplications,96definingsymbolsandvariables,116device-specificpreprocessingsymbols,389–390device-specificpreprocessingvariables,390–392deviceRequirementselement,50elementsandattributes,363–389full-screenmode,usingGUIin,163–164integratingJ2MEPolishintoIDEs,19optimizinggameengine,146projecttag,56settingsymbolsandvariables,115testingsampleapplications,16usingextensionsin,235–236usingregisteredextensionin,236buttonappearancemode,186buttonselector,StringItem,186INDEX422bytedatatypeBinaryEditor,141bytecodemodification,244avoidingknownissues,307–308storingintegerarray,346bytespropertyfunction,118,399Ccachinghigh-levelperformancetuning,331calculationslow-levelperformancetuning,336Cancelcommandvariable,166labelforCancelcommand,393localizingJ2MEPolishGUI,90cancel-imageattribute,menubar,204CanvasHeightvariable,391CanvasSize,391devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,82CanvasWidthvariable,391capabilities,41cumulativeeffect,48definingsupportedlibraries,45determiningcanvasheightwith,52devicedatabase,42ifdirective,51inheritance,49precedencebetweenxmlfiles,48preprocessing,51–52selectingtargetdevicestobuildfor,82capabilities.
xmldevicedatabasefile,39implicitgroups,42capabilityelementdevices.
xml,41groups.
xml,44vendors.
xml,44captureproperty,MMAPI,357caret-charattribute,TextFields,225caret-colorattribute,TextFields,225carriermodificationsdifferencesbetweendevices,279carrierscarrierspecificattributes,355CBS(CellBroadcastService),417permissionsforsignedMIDlets,361CDC(ConnectedDeviceConfiguration),417J2MEconfigurations,275centerlayoutaligningitemswithlayoutattribute,193certificatesrootcertificates,318signingMIDlets,77vendorcertificates,318ChangeInputModeKeyvariable,391ChangeNumericalAlphaInputModeKeyvariable,391CHAPI(ContentHandlerAPI)optionalpackagesforMIDPdevices,277characterssupportedJTWIspecification,278charactersKeyvariables,TextField,165–166,395–396configuringtheTextField,168charactersKeyPoundvariable,166,396charactersKeyStarvariable,166,396checkbox-selectedattribute,ChoiceGroups,220checkboxavailabledynamicstyles,186ChoiceGroups,219checkbox-plainattribute,ChoiceGroups,220choice-colorattribute,ChoiceGroups,217,220ChoiceGroupsattributesfor,216availabledynamicstyles,186designing,215–222designingexclusive,216–219designingmultiple,219–221designingpop-up,221–222insertionpointsforstyledirectives,172preprocessingvariables,165typesof,215ChoiceItemclass,186chunk-widthattribute,Gaugeclass,223circlebackground,403–404circleborder,416circles-numberattributepulsating-circlesbackground,407classattributecopierelement,384filterelement,127,372finalizerelement,387keepelement,378midletelement,370obfuscatorelement,377packagerelement,384postcompilerelement,376preprocessorelement,372preverifierelement,380usingextensionsinbuild.
xmlfile,235classmodel,improvinggroupingfunctionalities,344–345minimizingsizeofJARfiles,344–348removingclassesandmethods,345storingarraydata,345–348classeschangingclassinheritance,51,119designphase,31directiveincluding/excluding,109ImageLoaderpreprocessingvariable,164obfuscatorremovingunusedclasses,133removingtoimproveclassmodel,345workingonmultipledevices,101classnamepropertyfunction,399transformingvariableswith,118using/avoidinginterfaces,331classPathattributecompilerelement,373copierelement,384finalizerelement,387INDEX423integratingcustombackground,268obfuscatorelement,377packagerelement,385postcompilerelement,376preprocessorelement,372preverifierelement,381usingextensionsinbuild.
xmlfile,235classpathelementregisteringprojectextensions,236classpathrefattributecompilerelement,373CLDC(ConnectedLimitedDeviceConfiguration),274,417device-specificpreprocessingsymbols,390J2MEconfigurations,275CLDC1.
0profilewritingportablecode,295cldcgroupsassemblingresources,70cleanbuildbuildingaMIDlet,61Clearcommandvariable,166labelforClearcommand,394localizingJ2MEPolishGUI,91suppressClearCommandvariable,165,168ClearKeyvariable,392clientframework,30clientClassattributehandlerelement,372clockresolutionJTWIspecification,278codeadjustments,avoidingknownissues,305–308manipulatingbytecode,307–308usingpreprocessing,305–307writingportablecode,294–303usingdifferentsourcefiles,300–303usingdynamiccode,295–298usinglowestcommondenominator,295usingpreprocessing,298–300colorattributeavailablefontattributes,196circlebackground,404circleborder,416Gaugeitems,223imagebackground,402openingbackground,408opening-round-rectbackground,409pop-upChoiceGroups,221pulsating-circlebackground,406round-rectbackground,401round-rectborder,413round-tabbackground,410shadowborder,414simplebackground,400simpleborder,412top,bottom,left,andrightborders,415colorsalphablending,195buildingaMIDlet,63caret-colorattribute,TextFields,225defining,194definingcolors,CSS,193–195designingnormalmenubar,202namingconventions,194predefinedcolors,193Series40Nokiadevices,284Series60Nokiadevices,286colorssection,polish.
cssfile,189,194columnsattributearrangingitemsonscreen,206ChoiceGroups,216usingwithviewtypes,207columns-widthattributearrangingitemsonscreen,206ChoiceGroups,216"Commandnotfound"sampleapplicationerrormessages,17commandActionmethodMIDletshowingamenu,59CommandListenerinterfaceminimizingclassesinJARfiles,344commandsCancelcommandvariable,166Clearcommandvariable,166commandpreprocessingvariables,166configuringTextFieldcommands,168configuring,J2MEPolishGUI,164–167Deletecommandvariable,166hasCommandKeyEvents,163,390keytoolcommand,77leftcommandstyle,204Markcommandvariable,166OKcommandvariable,166Optionscommandvariable,166rightcommandstyle,204Selectcommandvariable,166suppressClearCommandvariable,165suppressCommandsvariable,165,168suppressDeleteCommandvariable,165suppressMarkCommandsvariable,165suppressSelectCommandsvariable,165Unmarkcommandvariable,166commentcharacterspreprocessingdirectives,104–105commentsCascadingStyleSheets,188Commercial/None-GPLlicense,12comparisonoperators,108compilationseebuildphasecompilationphase,66–67buildphaseextensions,232usingJ2MEPolishascompiler,67compilerattributecompilerelement,373compilerargselement,376compilerelement,373–375attributes,tableof,373–374debuggingapplications,99extendingbuildphases,243INDEX424compilerargselement,375,376compilerDestDirattributebuildelement,366compilerModeattributebuildelement,366compilerModePreverifyattributebuildelement,367componentsbuildframework,30clientframework,30IDEplug-ins,30installing,13layersofcomponents,29stand-alonetools,30compressionparameter7-Zippackager,79,385conditiondirective,398description,105implementingStringListItemclass,255include/excludeclasses/interfaces,109conditionalparametersconfiguringanextensionwith,234usingextensionsconditionally,236conditionsdebuggingapplicationsusing,96–98configurationattribute,infosection,363configurationproperty,MIDP,357configurationvariables,392–397configurationsConnectedDeviceConfiguration,274ConnectedLimitedDeviceConfiguration,274differencesbetweendevices,274–275J2MEconfigurations,275Nokiadevices,285Siemensdevices,289SonyEricssondevices,291configurations.
xml,39configuremethod,234ConnectedDeviceConfigurationseeCDCConnectedLimitedDeviceConfigurationseeCLDCconnectionsseealsonetworkingtelecommarket,280ConstantPoolTagparameterDashOProobfuscator,380constructorsintegratingCSSintocustomitems,256settingstyle,257containerslow-levelperformancetuning,335contentsproperty,MMAPI,357cookiesHTTPnetworking,312trackingnumberoftimesinstalled,34copierelement,resources,383–384attributes,tableof,384extendingbuildphases,245copyrightattribute,infosection,363Countdefinition,140countriesISOcountrycode,89localizedcountryname,89createNewStatementmethodbackgroundconverter,268CSS(CascadingStyleSheets)seealsopolish.
cssfilealigningitemswithlayoutattribute,192–193backgroundsandborders,198–199beforeandafterattributes,197–198bitmapfonts,197briefdescription,417comments,188commondesignattributes,189–199creatingserver-sideBackgroundclass,267CSSboxmodel,191–192CSSdeclaration,187CSSsyntax,187–188definingcolors,193–195designingtheGUI,181–229designingwithfontattributes,196effectofdifferentpolish.
cssfiles,169groupingattributes,187labels,197namingconventions,187registeringcustomCSSattributes,259structureofpolish.
cssfile,189structureofstyledefinition,189–191CSSstylesseealsostylesapplyinginMIDletconstructor,63applyingtoaform,171componentsof,182defininginresources/polish.
cssfile,172handlingcustomitems,256integratingintocustomitems,256referringtootherstyles,188setting,113currenciescodeforusedcurrency,89localization,88symboloftranslation'scurrency,89currentsettingsymbolsforreadingcurrentsetting,397currentlyfocuseditemusingbottomborderfor,415usingcirclebackgroundfor,404usingcircleborderfor,416usingimagebackgroundfor,403usingopeningbackgroundfor,408usingopening-round-rectbackgroundfor,410usingpulsatingbackgroundfor,405usingpulsating-circlebackgroundfor,406usingpulsating-circlesbackgroundfor,407usinground-rectbackgroundfor,402usinground-rectborderfor,413usingshadowborderfor,414usingsimpleborderfor,412usingtextoflistitemastitle,211–212usingtranslucentbackgroundfor,401INDEX425currentTimeMilismethod,Systemclass,328customitemsseecustomizationscustomloglevels,127custom-css-attributes.
xmlfile,259custom-extensions.
xmlfile,270customApisattribute,buildelement,367customDevicesattribute,buildelement,367customGroupsattribute,buildelement,367CustomItemclasswritingcustomitems,248CustomItemstroubleshootingSonyEricssondevices,291customizationsbackgrounds,265borders,269customitems,designing,256,261customitems,handling,255–261customitems,writing,248–261extendingbuildtoolsseebuildextensionsfinalizer,integrating,247loggingframework,extending,269–270obfuscator,integrating,244packagers,usingcustom,246preprocessor,239–243preverifier,integrating,245problemsimplementinglow-levelGUI,309propertyfunction,248registeringcustomCSSattributes,259scrollablelistitem,248customVendorsattribute,buildelement,367Ddampingattribute,droppingview,208DashOProobfuscator,379combiningseveralobfuscators,95parameters,380DashoHomeparameter,380dataeditingdatawithBinaryEditor,140datafilescreating/manipulatingbinarydatafiles,138dataprotocolsHTTPnetworking,311datatypesBinaryEditor,141dataSizeattribute,infosection,363DateFieldclassavailabledynamicstyles,186DateFieldsadditionalattributesfor,226designingDateFields,226–227DateFormatvariable,394DateFormatEmptyTextvariable,394DateFormatSeparatorvariable,394datesdateformatting,138formatDatefunction,88localization,88debugattribute,compilerelement,373Debugclass,138debugdirective,398description,105loggingframework,113loggingmessages,123prioritylevelofmessages,124debugelement,build.
xml,371–372attributes,127,371controllingloggingframework,125–126debuggingapplications,96debuggingapplicationsusingconditions,98enablingbenchmarkloglevel,329debugEnabledpreprocessingsymboldetectingifloggingframeworkactive,129debugging,96–99addingdebugcodeforloglevels,125compilationphase,67controllingloggingframework,125symbolsforreadingcurrentsetting,397trackingbugsonrealdevices,127usingconditions,96–98usingJ2MEPolishascompiler,98–99debuglevelattribute,compilerelement,374defaultattributelocalizationelement,383projectelement,56registeringcustomCSSattributes,260defaultpackageobfuscatingapplications,95defaultstyle,184defaultexcludesattribute,resourceselement,382defaultFrameIndexargumentsofSpriteItemconstructor,179defensiveprogramming,304–305definedirective,105,398defining/removingsymbols/variables,109definitionfiles,139Countdefinition,140savingdefinitionfiles,141Deletecommandvariable,166labelforDeletecommand,394localizingJ2MEPolishGUI,90suppressDeleteCommandvariable,165,168deletemethodadditionalTabbedFormmethods,174deleteConfirmattribute,infosection,363deleteNotifyattribute,infosection,363dependattribute,compilerelement,374dependenciesAnttargets,58deploymentphaseapplicationlifecycle,31,33deprecationattribute,compilerelement,374descriptionattribute,infosection,363registeringcustomCSSattributes,260descriptionelementapis.
xml,45bugs.
xml,47designphaseapplicationlifecycle,30–31INDEX426designsapplyingdesireddesignstyles,171designdefinitions,181sampleapplicationindarkdesign,170sampleapplicationindefaultdesign,169sampleapplicationinpopdesign,169storingdesignsettingsandfiles,181usingdifferentdesignsforapplication,168destDirattributebuildelement,367compilerelement,374DevelopmentPlatform2.
0Series40Nokiadevices,284devicedatabase,39–53automaticresourceassembling,49avoidingproblems,121changingandextending,52commoncapabilities,42definingcapabilitiesandfeatures,48–49definingdevices,40–43defininggroups,44–45definingissues,47–48defininglibraries,45–47definingvendors,44determiningcanvasheightwithdevicecapabilities,52optimizingtargetdevices,51preprocessing,51resourceassembling,50selectingdevicestobuildfor,82selectingresourcesfortargetdevices,50selectingtargetdevices,49–50using,49–52usingseveralvariablevaluesindividually,111XMLfilesdescribed,39XMLformat,39–49deviceelement,devices.
xml,40supportsPolishGuiattribute,42devicegroupsdefiningingroups.
xml,45designingtheGUIfor,182–183deviceidentificationaccessingnativefunctionality,320MSISDN,319retrievingGloballyUniqueID,319solvingcommonproblems,318devicelibrariesNokiadevices,285optionalpackagesforMIDPdevices,276–278portinglow-levelgraphicsoperations,152Siemensdevices,289SonyEricssondevices,291specifyingdefaultpathof,46specifyingfilenamesof,46specifyingsupportedlibraries,45specifyinglibrariesinapis.
xml,45–46specifyingname,45supportedlibrarynotdefinedinapis.
xml,45usingfloating-pointemulationlibraries,315usingoptional/device-specificlibraries,118DeviceControlclass,138allowingfordevicevibration,156deviceRequirementselement,build.
xml,50,365attributes,tableof,365buildingaMIDletwithJ2MEPolish,61debuggingapplicationsusingconditions,98nestedelements,tableof,365selectingdevicestobuildfor,80–83selectingtargetdevicesforbuildphase,65devicesseealsotargetdevicesactivatingGUIfor,161applyingfilterforspecific,76buildingformultiple,80–84carriermodifications,292controllingGUI,161controllingvibrationanddisplaylight,156designingGUIfor,182–183differencesbetweendevices,273–280carriermodifications,279configurations,274–275emulators,280firmwareversions,279formats,279hardware,273–274profiles,275–276directoriesforspecific,70distinguishingbetween,66integratingdeviceAPIs,94JARsizevariation,273JTWIspecification,278–279manufacturersof,281MIDPdevicepackages,276–278MobileServiceArchitecture,278–279preprocessingsymbolsandvariables,114device-specificsymbols,389–390device-specificvariables,390–392realdevices,127–130selectingdevicestobuildfor,80–83settingvariablesfor,117testingcapabilitiesof,143usinghard-codedvalues,120usingoptional/device-specificlibraries,118vendorcharacteristics,283–292LGElectronics,290Motorola,287–288Nokia,283–287RIMBlackBerry,291Samsung,288–289Siemens,289–290SonyEricsson,290–291workingonmultiple,101devicesattribute,buildelement,366deviceselement,devices.
xml,40devices.
xml,40–43definingcapabilitiesandfeatures,48definingemulatorargumentsin,247defininggenericphonein,40definingNokia6600phonein,40definingsupportedlibraries,45devicedatabasefile,39INDEX427diameterattributecirclebackground,404dirattributefilesetelement,382resourceselement,69,382sourceelement,369directinputattribute,TextFields,224directinputmode,168direct-inputCSSattribute,168directivesseepreprocessingdirectivesdisplayarea,133distdirectorybuildingaMIDlet,61distributionseealsovendorsminimizingtargetdevices,83docfolder,15DoJaplatforms,294vendorforums,322downloadsAnt,9EclipseIDE,8J2MEPolishinstaller,11J2SE,7JBuilder,8NetBeans,8vendor-specificemulators,10WirelessToolkit,8drawRGBmethod,Graphicsclassavoidingknownissuesusingpreprocessing,306–307drawRgbOriginbugportinglow-levelgraphicsoperations,153droppingview,208DSAPI(DataSyncAPI)optionalpackagesforMIDPdevices,277dynamicattribute,localizationelement,383dynamicclassesexcludingfromobfuscation,377keepinginproject,378dynamiccodingwritingportablecode,295–298dynamicimageloading,261–265dynamicstylesavailabledynamicstyles,186designingGUI,183,185–186integratingCSSintocustomitems,258namingconventions,185programmingGUI,173staticstylescompared,64EEclipseIDE,8implementationphase,32installingJ2MEPolishplug-ins,22integratingJ2MEPolishinto,20–22integratingwithAnt,20–21namingconventions,21usingdifferentsourcefiles,302–303writingportablecodeusingpreprocessing,299elifdirective,105,398seealsoifdirectivecheckingformultiplepreprocessingsymbols,107elifdef/elifndefdirectives,104,398seealsoifdirectivecheckingforsinglepreprocessingsymbols,106elsedirective,104,398seealsoifdirectivecheckingformultiplepreprocessingsymbols,107checkingforsinglepreprocessingsymbols,106emulationphasebuildphaseextensions,232emulatorelement,build.
xml,388attributes,tableof,388buildingaMIDletwithJ2MEPolish,61debuggingapplicationsusingconditions,98emulatorsdefiningemulatorargumentsindevices.
xml,247differencesbetweendevices,280downloading,10extendingbuildphases,247floating-pointemulationlibraries,315invoking,68measuringperformanceontargetdevices,328Siemensdevices,289testingphase,32WTKemulator,326enableFlowObfuscationparameterDashOProobfuscator,380KlassMasterobfuscator,379enableMemoryMonitorattributeemulatorelement,388enableNetworkMonitorattributeemulatorelement,388enableOptimizationparameterDashOProobfuscator,380enableProfilerattribute,emulatorelement,388measuringperformanceinWTKemulator,326enableRenamingparameterDashOProobfuscator,380enableStringEncriptionparameterDashOProobfuscator,380encodingattributebuildelement,367compilerelement,374encodingproperty,MIDP,357encodingproperty,MMAPI,357–358end-colorattributepulsatingbackground,405endifdirective,104,399seealsoifdirectivecheckingformultiplepreprocessingsymbols,107checkingforsinglepreprocessingsymbols,106environmentvariablessetting,9equals(#=)directive,105,398includingvaluesofvariablesincode,110INDEX428equals(==)comparisonoperator,108errormessagesloggingframework,113sampleapplications,17errorstrackingerrors,123escapingescapingspecialcharactersintranslations,89Evaluationlicense,12eventhandlingdesignphase,31DoJaplatforms,294minimizingnumberofclassesinJARfiles,345problemsimplementinguserinterface,308exceptionslogginganexception,129loggingframework,124passingerrorstologgingframework,127stacktracesofexceptions,124verbosedebuggingmode,124excludesattributecompilerelement,374resourceselement,382filesnottoincludeinapplicationbundle,70savingdefinitionfiles,141excludesfileattribute,compilerelement,374exclusiveChoiceGroupsadditionalattributesforitemsin,217designing,216–219radioboxesand,216withstandardselectionmarker,218exclusivelists,211exclusiveviewtypedesigningexclusiveChoiceGroups,217,219executableattributecompilerelement,374packagerelement,384usingthird-partypackagers,78expandlayoutaligningitemswithlayoutattribute,193explicitgroups,51,72groups.
xml,44extdirsattribute,compilerelement,374extendingbuildphasesseebuildextensionsextendingJ2MEPolish,248–269extendingloggingframework,269–270extendskeywordextendingstyles,182Extensionclassextendingbuildphases,232externaltoolsinstalling,15Ffaceattributeavailablefontattributes,196failonerrorattribute,compilerelement,374fastbytesparameter7-Zippackager,79,385FC(FileConnection)APIoptionalpackagesforMIDPdevices,277FeaturePacks1,2,and3Series60Nokiadevices,286Featurerequirementselectingtargetdevicestobuildfor,83featureselementdevices.
xml,41groups.
xml,44vendors.
xml,44feedbacktousersimprovingperceivedperformance,339–340fileattributecompilerargselement,376jadelement,386parameterelements,233variableelement,370fileXMLattribute,75FileConnectionAPIpermissionsforsignedMIDlets,362filescreating/manipulatingbinarydatafiles,138definitionfiles,139managinglevelfiles,139fileselement,apis.
xml,46filesetelement,resources,382attributes,tableof,382resourceassembling,72,73filterelement,debug,127,371–372attributes,tableof,372loglevelsforclasses/packages,125finalmodifierusingaccessmodifiers,338finalizephasebuildphaseextensions,232finalizerelement,build.
xml,387attributes,tableof,387extendingbuildphases,247firmwareversionsdifferencesbetweendevices,279first-colorattributepulsating-circlesbackground,407FlashformobiledevicesJ2MEcompetitors,282flexiblefolderssolvingcommonproblems,303Floatertool,316floating-pointcalculationsbytecodemodification,244floating-pointcalculation,314floating-pointemulationlibraries,315Series60Nokiadevices,286solvingcommonproblems,314usingintegerinsteadof,314usingonlyintegers,315flushGraphicsmethodrunninggameinfull-screenmode,148Focuseditemdesigning,228INDEX429focusedstyle/focused-styleattributedesigningChoiceGroups,216designingmenus,200predefinedstyles,184structureofstyledefinition,189foldersflexiblefolders,303fontattributesdesigningwith,CSS,196structureofstyledefinition,189FontEditor,142–143convertingTrueTypeintobitmap,142creatingbitmapfontwith,142Fontvariables,391font-bitmapattribute,197fontsbitmapfonts,197BitMapFontclass,136convertingTrueTypeintobitmap,136,142customfontsdisplayingmessages,133customizing,133fontattributes,196fontfaces,136fontsizes,136fontstyles,136J2MEfontsupport,136Motoroladevices,287specifyingfontsettings,196fontssection,polish.
cssfile,189foreachdirective,105,399finishing#foreachblock,111usingvariablevaluesindividually,111foregroundimage,210,211forkattribute,compilerelement,374Formclassappendmethod,256availabledynamicstyles,186Formelementsinsertionpointsforstyledirectives,172formatDatefunction,88formatsdifferencesbetweendevices,279formsapplyingCSSStyleto,171designing,213designingFramedForms,214designingTabbedForms,213programmingFramedForm,176programmingSpriteItem,178programmingTabbedForm,174usingdynamicstyles,173forums,321,322forwardvariable,ScreenChangeAnimation,395FP(FoundationProfile)devicesJ2MEprofiles,276FPLiblibrary,315framestyle,185FramedFormclassadditionalmethods,177availabledynamicstyles,186designinglowerframe,214programming,176–178using,177,215FramedFormsdesigning,214full-screenattribute,buildelement,367full-screenmodeactivating,394enabling,163eventsforsoftkeys,164optimizinggameengine,147–148troubleshootingSonyEricssondevices,291avoidingknownissuesusingpreprocessing,305usingdifferentsourcefiles,301usingdynamiccoding,296usingGUIin,163–164usingpreprocessing,298full-screenvariable,391FullCanvasclassneedsNokiaUiForSystemAlertsbug,305–306FullCanvasHeightvariable,391FullCanvasSize,391devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,82FullCanvasWidthvariable,391fullscreenattribute,buildelementrunninggameinfull-screenmode,147usingGUIinfull-screenmode,163FullScreenvariable,166usingGUIinfull-screenmode,163FullScreenPreprocessorextensionregisteringextensions,236usinginbuild.
xmlfile,235functionalities,groupingimprovingclassmodel,344–345GgameenginedefiningGridTypeofTiledLayer,149hownottouse,146optimizing,146–150portingMIDP2.
0gametoMIDP1.
0device,152–157controllingvibrationanddisplaylight,156–157portinglow-levelgraphicsoperations,152–155portingsoundplayback,155–156runninggameinfull-screenmode,147–148splittingimageintosingletiles,149using,145–146usingbackbufferinTiledLayer,148–149usingforMIDP2.
0devices,150workingaroundlimitationsof,150–151gameprogramming,145–157measuringperformanceoftypicalgameloop,328GameCanvasrunninggameinfull-screenmode,147–148INDEX430gap-colorattribute,Gaugeclass,223gap-widthattribute,Gaugeclass,223Gaugeclass/itemsadditionalattributesfor,223availabledynamicstyles,186designingGaugeitems,222–224improvingperceivedperformance,340GCF(GenericConnectionFramework),417GeneralPublicLicenseseeGPLgetBooleanPropertymethod,259getColormethod,255getFontmethod,255getHeightmethod,297,299getIntPropertymethod,259getKeyStatesmethod,150getObjectPropertymethod,259getPrefContentHeightmethod,251,255getPrefContentWidthmethod,251,255getPropertymethod,259getSelectedTabmethod,174gigabytespropertyfunction,400transformingvariableswith,118glossaryabbreviations/acronymsglossary,417GPL(GeneralPublicLicense),12,417graphicslow-levelperformancetuning,335portinglow-levelgraphics,152Graphicsclassportinglow-levelgraphics,152greaterthan(>)comparisonoperator,108GridTypevariable,TiledLayer,396definingGridTypeofTiledLayer,149groupelement,groups.
xml,44groupingfunctionalitiesimprovingclassmodel,344–345groupsdevice-specificpreprocessingsymbols,390explicitgroups,51,72groupsforassemblingresources,70hierarchicalorderingof,72implicitgroups,41,51,72groupsattribute,buildelement,367groupselementdevices.
xml,41groups.
xml,44groups.
xml,44–45definingcapabilitiesandfeatures,48definingdevicegroupsin,45definingsupportedlibraries,45devicedatabasefile,39explicitgroups,44GUI(Graphicaluserinterface),417seealsoJ2MEPolishGUIGUIitemsseeitemsHh.
263groupassemblingresources,71handlerelement,debug,372activatingloghandlers,130attributes,tableof,372hard-codedvalues,120hardwaredifferencesbetweendevices,273–274hasCommandKeyEventsfeaturedevice-specificpreprocessingsymbols,390MIDP2.
0devicessupportingmenumode,163heapsizeMotoroladevices,287optimizingapplications,325Series40Nokiadevices,284heapsJTWIspecification,278HeapSize,391devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,83heightattributeDateFields,226Gaugeitems,223TextFields,224helpgettinghelp,321helperclassesminimizingclassesinJARfiles,345hexvaluedefiningcolors,195hideNotifymethod,Canvasdetectinginterruptions,320pauseAppmethod,321Series40Nokiadevices,284hidingstatements,112high-levelGUIproblemsimplementing,308high-levelperformancetuning,329–334algorithms,334architecture,330–331networking,332protocols,331–332recordstores,332–334reducingabstraction,330reusingandcachingobjects,331threading,331HTTPnetworkingnetworkingproblems,311authentication,312cookies,312dataprotocols,311sessions,312permissionsforsignedMIDlets,360hyperlinksappearancemode,186INDEX431IiAppliplatforms,294IBM'sWEMEvirtualmachine,293iconattribute,midletelement,370icon-imageattributeexclusiveChoiceGroups,217listitems,213multipleChoiceGroups,219icon-image-alignattributeexclusiveChoiceGroups,217listitems,211,213multipleChoiceGroups,219IconItemclassavailabledynamicstyles,186iconsMotoroladevices,287Samsungdevices,288IDEplug-ins,30identifierelement,devices.
xml,41Identifierrequirementtargetdevicestobuildfor,83Identifiervariable,391IDEs,8Eclipse,20–22integratingJ2MEPolishinto,19–26IntelliJ,24–25JBuilder,24NetBeans,23–24ifattributeaddingattributeforcurrenttargetdevices,75applyingfilterforspecificdevices,76compilerelement,374copierelement,resources,384debugelement,127–128,371deviceRequirementselement,365emulatorelement,388filesetelement,resources,382finalizerelement,387jadelement,386localizationelement,resources,383midletelement,370obfuscatorelement,377packagerelement,385parameterelements,233parameterelement,emulator,389postcompilerelement,376preprocessorelement,373preverifierelement,381selectingdevicestobuildfor,81sourceelement,sources,369sourceselement,369variableelement,371ifdirective,105,399branchingcode,105capabilities,51checkingformultiplepreprocessingsymbols,107checkingformultiplesymbols,106checkingforsinglepreprocessingsymbols,105commentingoutstatementinifblock,105comparingvariables,106comparingvariablesandconstants,107nestingdirectives,114ifdefdirective,104,399checkingforsinglepreprocessingsymbols,106commentingoutstatementinifdefblock,105ifndefdirective,104,399checkingforsinglepreprocessingsymbols,106imageattributeforegroundimage,210Gaugeitems,223imagebackground,402pop-upChoiceGroups,221imagebackground,402–403Imageclass,152ImageFormatvariable,391ImageItemclass,186ImageItemsdesigning,215ImageLoaderclassgettingimagesfromwebserver,262integratingcustom,264loadingimagesdynamically,262ImageLoaderpreprocessingvariable,164,393imageLoadStrategyattribute,buildelement,368imagesavailabledynamicstyles,186device-specificpreprocessingsymbols,390JTWIspecification,278loadingimagesdynamically,261–265minimizingsizeusingappropriateresources,349settingaforegroundimage,210solvingcommonproblems,303IMAPI(InstantMessagesAPI)optionalpackagesforMIDPdevices,277IMEI(InternationalMobileEquipmentIdentity),417deviceidentification,318IMP(InformationModuleProfile),275,417J2MEprofiles,276implementationphase,30,32implicitgroups,41,51,72importfolder,15importstatementsfullyqualifiedclassnames,usinginsteadof,95usingcorrect,170–171usinggameengine,146IMSI(InternationalMobileSubscriberIdentity),417deviceidentification,318inactivetabstyledesigningTabbedForms,213predefinedstyles,185includedirective,105,399includingexternalcode,112includeAntRuntimeattribute,compilerelement,374includeJavaRuntimeattribute,compilerelement,374INDEX432includesattributecompilerelement,374filesetelement,resources,382includesfileattribute,compilerelement,374infoelement,build.
xml,363–364attributes,tableof,363–364buildingaMIDlet,61specifyingattributes,74infostyle,184infoUrlattribute,infosection,363inheritancecapabilities,49changingclassinheritance,51,119devices,48parentlibraries,46inittarget,126initializationhandlingcustomitems,255inputdirectinputattribute,TextFields,224InputTimeoutvariable,165showInputInfovariable,165useDirectInputsymbol,165inputmodesconfiguringtheTextField,167inputtitlevariable,166localizingJ2MEPolishGUI,91titleofTextBox,397InputStreams,BluetoothSeries60Nokiadevices,286InputTimeoutvariable,TextField,165,395insertionpointsstyledirectives,172installationdirectoryfolders,15installationsJ2MEPolish,4,11–15J2SE,7statuscodes,35third-partytools,15trackingnumberoftimesinstalled,34WirelessToolkit,8installNotifyattribute,infosection,363instancevariableslow-levelperformancetuning,337thiskeyword,21intdatatype,BinaryEditor,141integrationintegratingJ2MEPolishintoIDEs,19IntelliJintegratingJ2MEPolishinto,24–25interactionmodeshandlingcustomitems,255interfacesdesignphase,31designinguserinterfaces,160directiveincluding/excluding,109GUIseeJ2MEPolishGUIinterfaceconcepts,160reducingabstraction,330interruptionsdetecting,320intervalsanimationIntervalsymbol,164issuesseetroubleshootingItemconstructorsinsertionpointsforstyledirectives,172itemsarrangingitemsonscreen,206customitems,handling,255–261designing,215–228designingChoiceGroups,215–222designingDateFields,226–227designingFocuseditem,228designingGaugeitems,222–224designingImageItems,215designingStringItems,215designingTextFields,224–226designingTickers,227–228staticstyles,184JJ2EE(Java2EnterpriseEdition),7,417J2ME(Java2MicroEdition),7,418competitors,282J2MEapplicationsbuildframeworkfor,30J2MEmarket,282J2MEPolishapplicationlifecycle,30downloading,4forums,321,322installationdirectoryfolders,15installing,4,11–15installingcomponents,13licensing,11,417running,4sampleapplications,15–17errormessages,17testing,16J2MEPolishGUIactivating,161–162backgrounds,400–411circlebackground,403–404imagebackground,402–403openingbackground,408–409opening-round-rectbackground,409–410pulsatingbackground,404–405pulsating-circlebackground,406pulsating-circlesbackground,407–408round-rectbackground,401–402round-tabbackground,410–411simplebackground,400–401backgrounds,creatingcustom,265–269client-sideBackgroundclass,265–267integrating,268–269server-sideBackgroundclass,267–268borders,412–416circleborder,416creatingcustom,269INDEX433round-rectborder,413shadowborder,414simpleborder,412top,bottom,left,andrightborders,415changingappearance/logicof,164configuring,162–170commands,labels,andbehavior,164–167differentdesignsforapplication,168–170full-screenmode,163–164TextField,167–168withpreprocessingvariablesandsymbols,167controlling,161–170creatingprofessionalGUIs,159customitems,248–261applyingastyle,256designing,256–261designingcustomitem,261initialization,255interactionmodes,255registeringcustomCSSattributes,259designing,181–229commondesignattributes,189–199extendingstyles,187fordevicesanddevicegroups,182–183items,215–228reviewingCSSsyntax,187–188screens,199–215usinganimations,228–229usingdynamic,static,andpredefinedstyles,183–186drawback,160extending,248–269images,loadingdynamically,261–265introductionandwarning,159problemsimplementing,308usinghigh-levelGUI,308usinglow-levelGUI,309programming,170–181FramedForm,176–178portingMIDP2.
0applicationstoMIDP1.
0platforms,173settingstyles,171–173SpriteItem,178–181TabbedForm,174–176usingcorrectimportstatements,170–171usingdynamicstyles,173usingpredefinedstyles,173ScrollableListitem,creating,248–255usePolishGuipreprocessingvariable,166J2MEPolishinstaller,11J2SE(Java2StandardEdition),7,418installing,7JAD(JavaApplicationDescriptor)glossaryofabbreviations,418JADandManifestattributes,353–356defininginmessages.
txtfile,88deviceidentification,319managing,packagingphase,74–77MIDP1.
0attributes,353–354MIDP2.
0attributes,354–355sortingandfilteringattributes,75–77sortingwithjadFilterelement,386targetXMLattributespecifying,75troubleshootingSamsungdevices,288vendorandcarrierspecificattributes,355–356Jaddecompiler,15stacktracesinemulators,124jadelement,buildsection,385–386attributes,tableof,386specifyingattributes,74JADfilesconfiguringapplications,119JTWIspecification,278webserversconfiguring,34jadFilterelement,386sortingandfilteringJADattributes,75–76defaultJADfilter,77JAM(JavaApplicationManager),418JAR(JavaARchive)files,418JTWIspecification,278minimizingsizeof,78,344–350handlingresources,349–350improvingclassmodel,344–348minimizingnumberofclasses,344obfuscatingandpackagingapplication,350usingappropriateresources,349webserversconfiguring,34JARpackager,78JARsizeDoJaplatforms,294Motoroladevices,287variationbetweendevices,273jarNameattribute,infosection,364adjustingJARname,89localizations,85jarNamevariable,394jarUrlattribute,infosection,364Java2SDK(SoftwareDevelopmentKit)editionsof,7"JavaCompilercannotbefound"sampleapplicationerrormessages,17Javalinecommentcharacters,104JavaplatformsSonyEricssondevices,290JavaVerifiedinitiative,318carriermodifications,292minimizingtargetdevices,84permissions,77javac-targetcompilationphase,66JavaConfiguration,391standardpreprocessingsymbolsandvariables,115devicedatabase,43selectingtargetdevicestobuildfor,82javacTargetattribute,buildelement,368compilationphase,67JavaPackage,391devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,82INDEX434JavaPlatform,391devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,82JavaProtocol,391devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,82JavaRanchforum,322javax.
microedition.
lcduipackage,159configuringtheTextField,167JAVA_HOMEvariable,9Jazelle,293Jbedplatform,Esmertec's,293JBlendJVM,293accessingnativefunctionality,320JBuilderIDEdownloadfor,8integratingJ2MEPolishinto,24JCP(JavaCommunityProcess),418JMFPlibrary,315JNI(JavaNativeInterface)accessingnativefunctionality,320JSR(JavaSpecificationProcess),418JTWI(JavaTechnologyfortheWirelessIndustry),418device-specificpreprocessingsymbols,390differencesbetweendevices,278–279Juiceroptimizer,331JVM(JavaVirtualMachine),418Kkeepelement,obfuscator,377–378KEITAI-Lmailinglist,322keyattribute,signelement,387keyscharactersKeyvariables,165–166charactersKeyPoundvariable,166charactersKeyStarvariable,166generatingatemporarykey,77invalidLocalecalls,89softkeys,164keystoreattribute,signelement,387keytoolcommandgeneratingatemporarykey,77kilobytespropertyfunction,400transformingvariableswith,118KlassMasterobfuscator,379knownissuesseetroubleshootingKVM(KilobyteVirtualMachine),418KVM-INTERESTmailinglist,322KZIPpackager,15,79–80parameters,385Llabelstyle,184label-styleattribute,197labelsargumentsofSpriteItemconstructor,179commondesignattributes,CSS,197configuring,J2MEPolishGUI,164–167languageISOlanguagecode,88localizedlanguagename,89LAPI(LocationAPI)optionalpackagesforMIDPdevices,277layoutattributealigningitemswith,192–193availablelayoutvalues,193structureofstyledefinition,189layoutmethodBitMapFontViewerclass,137lcduiclassesusingcorrectimportstatements,171leftanimationscreenchangeanimations,229leftborder,415leftlayoutaligningitemswithlayoutattribute,193leftcommandstyle,204leftframestyle,185LeftSoftKey,163,392lengthshow-lengthattribute,TextFields,225lessthan(tor,108levelattributedebugelement,127,371filterelement,debug,372levelfilesmanaginglevelfiles,139LGElectronicsvendorcharacteristics,290vendor-specificattributes,355librariesseedevicelibrarieslibrarieselement,buildsectionintegratingbinarythird-partyAPIs,93licenseattribute,infosection,364licensingJ2MEPolish,11,417lineattribute,compilerargselement,376Listclassavailabledynamicstyles,186listelementsinsertionpointsforstyledirectives,172listitemscreatingscrollablelistitem,248Listscreendesigningscreenbackground,200listfilesattribute,compilerelement,374listsadditionalattributesforlistitems,213designing,211exclusivelists,211multiplelists,211usingtextofcurrentlyfocusedlistitemastitle,211–212localvariableslow-levelperformancetuning,338Localeclass,138localeproperty,MIDP,357INDEX435localesdefininglocales,85invalidLocalecalls,89localespecificmethods,138localizingapplications,86resourcesfolder,85supportingseverallocales,84localesattributelocalizationelement,resources,383resourceselement,382localizationadjustingJARname,89avoidingcommonmistakes,89–90buildinglocalizedapplications,84usinglocalefor,86currencies,88dates,88escapingspecialcharactersintranslations,89invalidLocalecalls,89localizingJ2MEPolishGUI,90–91managingtranslations,85–88resourceselementcontrolling,381settinglocalizedvariables,88usinglocalespecificresources,72usinglocalizedattributes,88localizationelement,resources,382–383attributes,tableof,383buildinglocalizedapplications,84–85debuggingapplicationsusingconditions,98supportingseverallocales,84LocationAPIpermissionsforsignedMIDlets,362loghandlersactivating,130creating,131extendingloggingframework,269–270RMSloghandler,130loglevelsaddingdebugcodefor,125customloglevels,127enablingbenchmarkloglevel,329enablingdifferent,forclasses/packages,125,127predefinedlevels,127testingforspecificloglevel,125whichlevelsapplywhenlevelset,125logviewerbuildingandinstalling,130filteringmessages,131findingsharedrecordstore,130loggingexceptions,129showinglogautomatically,128showinglogautomaticallyonerror,127showinglogmanually,129symbolsforreadingcurrentsetting,397testingphase,32loggingframework,113,123–131activating,126–128addingdebugcodeforloglevels,125addingexceptions,124advantageof,131controlling,125–128deactivating,125–128detectingifactive,129extending,269–270forwardinglogmessages,130loggingmessages,123–124measuringperformanceontargetdevices,328printingstacktrace,124stacktracesofexceptions,124viewinglogonrealdevices,128–130loggingmessages,123–124debugpreprocessingdirective,123disadvantages,123viewingloggedmessages,123LogHandlerclasscreatingloghandlers,131LogViewerMidletviewinglogentries,130longdatatypeBinaryEditor,141loopslow-levelperformancetuning,337performanceofgameloop,328unrolling,337low-levelGUIproblemsimplementing,309low-leveloptimizations,325low-levelperformancetuning,335–338acceleratingloops,337accessmodifiers,338containers,335graphics,335instancefields,337loops,337optimizedarithmeticoperations,336precalculatingdata,336switchstatement,336–337lowercasepropertyfunction,400transformingvariableswith,118MM3GAPI(Mobile3DGraphicsAPI)optionalpackagesforMIDPdevices,277MacOSXbinfolder,139WirelessToolkitfor,8mailinglists,322Makebuildtools,55ManifestattributesseeJADandManifestattributesmanifestFilterelement,386defaultManifestfilter,77Manifest-Versionasfirstelement,76sortingandfilteringManifestattributes,75–76manufacturersseevendorsINDEX436marginattributeCSSboxmodel,192definingsimplemargins,192structureofstyledefinition,189Markcommandvariable,166labelforMarkcommand,393localizingJ2MEPolishGUI,90marketJ2MEmarket,282telecommarket,280–281MathFPlibrary,315–316max-diameterattributepulsating-circlebackground,406pulsating-circlesbackground,407max-widthattributeachievingatabulararrangementwith,207max-widthCSSattribute,197structureofstyledefinition,189maximumattribute,droppingview,208MaxJarSize,392devicedatabase,43preprocessingsymbolsandvariables,115maxLightspropertyMobile3DGraphicsAPI,359maxperiodeattribute,droppingview,208MaxRecordStoreSizevariable,392maxSpriteCropDimensionpropertyMobile3DGraphicsAPI,359maxTextureDimensionpropertyMobile3DGraphicsAPI,359maxTransformsPerVertexpropertyMobile3DGraphicsAPI,359maxViewportDimensionpropertyMobile3DGraphicsAPI,359MBSAPI(MobileBroadcastServiceAPI)optionalpackagesforMIDPdevices,278megabytespropertyfunction,400transformingvariableswith,118memoryconsumptionmeasuring,341–342reducing,341–344reducingnumberofobjects,342usingrecursion,343memoryleaks,343memoryInitialSizeattribute,compilerelement,375memoryMaximumSizeattribute,compilerelement,375menubarsdesigning,202extendedmenubarsactivating,203designing,202,204predefinedstylesfor,204menubarstyle,204menumodeMIDP2.
0devicessupporting,163runninggameinfull-screenmode,147–148usingGUIinfull-screenmode,163menustyledesigningmenus,200predefinedstyles,184menubarstyle,204additionalattributesof,204menubar-colordesigningmenubar,202menuItemstyledesigningmenus,200predefinedstyles,184menusdesigning,200messagedirective,105,399analyzingpreprocessingphase,112messagesdefiningtranslationsinresources/messages.
txt,86displaying,136forwardinglogmessages,130–131logging,138retrievinglocalized,138specifyingprioritylevelof,124usingcustomfontsfordisplaying,133viewinglogged,123messagesattribute,localizationelement,383messages.
txtfiledefiningdefaulttranslations,87definingJADandManifestattributesin,88definingtranslationsin,86definingvariablesin,117localizingJ2MEPolishGUI,91settinglocalizedvariables,88methodsremovingtoimproveclassmodel,345MIAPI(MobileInternationalizationAPI)optionalpackagesforMIDPdevices,277MicroEdition-XyzattributesMIDP1.
0platforms,353microedition.
xyzpropertiessystemproperties,357–358MicroFloatlibrary,315–316midigroupassemblingresources,71midletelement,build.
xml,369–370attributes,tableof,370midlet-nvariable,classes,398MIDlet-XyzattributesMIDP1.
0platforms,353MIDP2.
0platforms,354vendor-specificattributes,356MIDlet.
getAppPropertyconfiguringapplications,119MIDlets,418applyingCSSstylesinMIDletconstructor,63buildingwithJ2MEPolish,60certificates,77creating"HelloWorld"application,58–64detectinginterruptions,320executionof,279INDEX437JTWIspecification,278LogViewerMidlet,130MIDP1.
0attributes,353MIDP2.
0attributes,354permissionsforsignedMIDlets,360–362showingamenu,58signingMIDlets,77–78,317SysInfoMIDlet,143trustedMIDlets,317midletselement,build.
xml,369–370MIDletX-Xyzattributesvendor-specificattributes,355MIDP(MobileInformationDeviceProfile),275,418device-specificpreprocessingsymbols,390J2MEprofiles,276optionalpackagesfor,276–278MIDP1.
0devicesportingaMIDP2.
0gameto,152–157usinggameenginefor,145MIDP1.
0platformsattributes,353–354MIDPplatforms,293portingMIDP2.
0applicationsto,173updatingapplication,36writingportablecode,295MIDP2.
0devicesportinggametoMIDP1.
0device,152–157usinggameenginefor,150MIDP2.
0platformsattributes,354–355MIDPplatforms,293portingtoMIDP1.
0platforms,173securitypermissions,360,362updatingapplication,36writingportablecode,295midpgroupsassemblingresources,70midp2viewarrangingitemsonscreen,209MIDPSysInfoMIDlet,143MIDxlet-Xyzattributesvendor-specificattributes,356min-diameterattributepulsating-circlebackground,406pulsating-circlesbackground,407min-widthattributeachievingatabulararrangementwith,207structureofstyledefinition,189mixingproperty,MMAPI,357MMAPI(MobileMediaAPI)optionalpackagesforMIDPdevices,276–277playingbackgroundmusicwith,313mmapigroupassemblingresources,71MMAPIsupportJTWIspecification,279MMS(MultimediaMessageService),418permissionsforsignedMIDlets,361Mobile3DGraphicsAPIproperties,359–360MobileGameDeveloperforum,322modeattribute,Gaugeclass,223modifierslow-levelperformancetuning,338modulesdesignphase,31Modulooperationsoptimizingapplications,325Mot-Xyzattributesvendor-specificattributes,355Motoroladeviceidentification,318knowndeviceissuesavailablemethod,InputStream,304vendorcharacteristics,287–288vendor-specificattributes,355vendor-specificemulators,10mp3groupassemblingresources,71mpeg-4groupassemblingresources,71MSA(MobileServiceArchitecture)differencesbetweendevices,278–279MSAPI(MobileSensorAPI)optionalpackagesforMIDPdevices,278MSISDN(MobileSubscriberISDNNumber)deviceidentification,319MTA(MobileTelephonyAPI)optionalpackagesforMIDPdevices,278MUICAPI(MobileUserInterfaceCustomizationAPI)optionalpackagesforMIDPdevices,278multimediaJTWIspecification,278–279MultimediaMessagingService(MMS)deploymentphase,34multipleChoiceGroupsadditionalattributesforitemsin,219–220checkboxesand,219designing,219–221multipledevicesbuildingfor,80–84multiplelists,211Nnameattributecopierelement,resources,384finalizerelement,387handlerelement,debug,372infosection,364jadelement,386midletelement,370obfuscatorelement,377packagerelement,384parameterelement,emulator,389parameterelement,obfuscator,378parameterelement,preprocessor,233postcompilerelement,376preprocessorelement,372preverifierelement,380registeringcustomCSSattributes,260INDEX438requirementelement,365usingregisteredextensionin,236variableelement,370nameelementapis.
xml,45bugs.
xml,47groups.
xml,44registeringextensionsforseveralprojects,236vendors.
xml,44Namevariable,392namingconventionsCascadingStyleSheets,187colors,194directoriesforspecificdevices,70dynamicstyles,185EclipseIDE,21predefinedstyles,184referringtoJ2MEPolishproperties,238nativefunctionsaccessingnativefunctionality,320needsNokiaUiForSystemAlertsbug,306nestingpreprocessingdirectives,114NetBeansIDEdownloadfor,8implementationphase,32integratingJ2MEPolishinto,23–24netiquette,321networkinghigh-levelperformancetuning,332networkingproblems,310Bluetooth,310HTTPnetworking,311shortmessageservice(SMS),310newline-afterlayoutaligningwithlayoutattribute,193newline-beforelayoutaligningwithlayoutattribute,193nextdirective,105,399Nextelcarriermodifications,292Nokiadeviceidentification,319mainfeaturesofNokiadevices,285Series40devices,284Series60devices,286Series80devices,287Series90devices,287vendorcharacteristics,283–287vendorforums,322vendor-specificattributes,356vendor-specificemulators,10nokia-uigroupassemblingresources,71nospacepropertyfunction,400not(!
)operatorbooleanoperatorsforevaluatingterms,107XMLencoding,73notequalto(!
=)comparisonoperator,108notnestedelementdeviceRequirementselement,365nowarnattribute,compilerelement,375numberattribute,midletelement,370numberpropertyfunction,400transformingvariableswith,118numTextureUnitspropertyMobile3DGraphicsAPI,359OO2carriermodifications,292ObfuscateFlowLevelparameterKlassMasterobfuscator,379obfuscation,94–96additionalAntpropertiesforantcallobfuscator,245combiningseveralobfuscators,95,378configuringanobfuscator,378excludingdynamicclassesfrom,377extendingbuildphases,244integratingunsupportedobfuscators,96minimizingsizeofJARfiles,350obfuscators,378–379specificobfuscatorsettings,378–380useDefaultPackageoption,95usingdefaultpackage,95yguardAnttask,237obfuscationphase,67buildphaseextensions,232obfuscatorelement,build.
xml,377antcallobfuscator,244attributes,tableof,377debuggingapplicationsusingconditions,98obfuscatorsDashOProobfuscator,379KlassMasterobfuscator,379ProGuardobfuscator,378RetroGuardobfuscator,379yGuardobfuscator,379object-orientedapproachdesignphase,31offsetattributeshadowborder,414OKcommandvariable,166labelforOKcommand,393localizingJ2MEPolishGUI,90openingbackground,408–409opening-round-rectbackground,409–410operatingsystemsMotoroladevices,287Nokiadevices,285Siemensdevices,289SonyEricssondevices,290optimizationphase,31,33optimizeattribute,compilerelement,375optimizingapplications,325–350gameengine,146heapsize,325JARfilesize,344–350low-leveloptimizations,325memoryconsumption,341–344overview,325–326INDEX439performanceimprovements,326–341measuringperformance,326–329perceivedperformance,338–341performancetuning,329–338targetdeviceconstraints,325optionalPermissionsattribute,infosection,364optionscommandvariable,166labelforOptionscommand,393localizingJ2MEPolishGUI,90options-imageattribute,menubar,204or(||)operatorbooleanoperatorsforevaluatingterms,107ornestedelementdeviceRequirementselement,365OS(operatingsystem)preprocessingsymbolsandvariables,115OSvariable,392OTA(OverTheAir)provisioning,418OTAdownload,deploymentphase,33Ppselectordynamicformpstyle,186StringItemclass,186packageattributefilterelement,debug,127,372packagerelement,384–385attributes,tableof,384extendingbuildphases,246usingthird-partypackagers,78packagers7-Zippackager,79custompackagers,246KZIPpackager,79third-partypackagers,78packagesoptionalforMIDPdevices,276–278packagingphase,68–80buildphaseextensions,232managingJADandManifestattributes,74–77sortingandfilteringattributes,75–77minimizingsizeofJARfiles,350resourceassembling,68–73finetuning,72–73includinggroupspecificresources,70–71selectingandloadingresources,72usinglocalespecificresources,72usingvendor/devicespecificresources,70signingMIDlets,77–78third-partypackagers,78–80paddingattributeCSSboxmodel,192definingpercentagepadding,192structureofstyledefinition,189paintmethodBitMapFontViewerclass,137StringListItemclass,255paintScreenmethodgameinfull-screenmode,148PAPI(PaymentAPI)optionalpackagesforMIDPdevices,277parameterelementemulator,389obfuscator,378packager,385preprocessor,233preverifier,381parametersinvalidLocalecalls,90parentelementapis.
xml,46devices.
xml,42groups.
xml,44passesparameter,7-Zippackager,79,385passwordattribute,signelement,387pathattribute,compilerargselement,376pathelement,apis.
xml,46PATHvariable,setting,9pauseAppmethoddetectinginterruptions,320hideNotifymethodsupported,321Series40Nokiadevices,284PBP(PersonalBasisProfile)devicesJ2MEprofiles,276PDAPIoptionalpackagesforMIDPdevices,277performanceimproving,326–341measuringperformance,326–329ontargetdevices,327–329typicalgameloop,328WTKemulator,326–327optimizationphase,33perceivedperformance,improving,338–341ensuringresponsiveness,340feedbacktousers,339–340splashscreen,339performancetuning,329–338high-level,329–334low-level,335–338permissionsJavaVerifiedinitiative,77MIDP2.
0security,360,362signedMIDlets,360–362trustedMIDlets,317permissionsattribute,infosection,364PersonalJavaprofileaccessingnativefunctionality,320PIM(PersonalInformationManagement)API,418optionalpackagesforMIDPdevices,277permissionsforsignedMIDlets,362pixel-levelcollisiondetectionworkingaroundlimitationsofgameengine,150plainappearancemode,186plainlayoutaligningitemswithlayoutattribute,193platformproperty,MIDP,357platformsDoJaplatform,294MIDPplatform,293mobileJavaplatform,292–294WIPI,294INDEX440platforms.
xmldevicedatabasefile,39plug-insEclipseplug-ins,22plussignselectingtargetdevicestobuildfor,82PNG(PortableNetworkGraphics),418PNG-ImagedatatypeBinaryEditor,141Pngcrush,15,349PNGGauntlet,15,349PNGOUT,15,349pointereventscheckingfor,51pointerPressedmethodStringListItemclass,255polish.
cssfileseealsoCSS(CascadingStyleSheets)backgroundssection,189usingmovingbackground,268borderssection,189buildingaMIDlet,62cascadingcharacterof,183colorssection,189,194comments,188completepolish.
cssfile,189customitem,designing,261definingCSSstyleinresources/polish.
cssfile,172designdefinitions,181devicesanddevicegroups,designingfor,183dynamicstyles,185fontssection,189structureof,189styledefinition,structureof,189,191basicstyledefinitioninresources,183polish.
xyzconfigurationvariables,392–397polish.
xyzpreprocessingsymbols,390polish.
xyzpreprocessingvariables,391–392polish.
xyzsymbolsforreadingcurrentsetting,397polishDirattribute,buildelement,368popupavailabledynamicstyles,186pop-upChoiceGroupsadditionalattributesforitemsin,221designing,221–222portingDoJaplatforms,294interfaceconcepts,160MIDP2.
0toMIDP1.
0,152–157,173usinghigh-levelGUI,308writingportablecode,294–303postcompilationphasebuildphaseextensions,232,244postcompilerelement,build.
xml,376–377attributes,tableof,376PP(PersonalProfile)devicesJ2MEprofiles,276predefinedcolors,193transparent,194predefinedstylesdesigningGUI,183,184–185namingconventions,184programmingGUI,173supportedpredefinedstyles,184preferencesattribute,emulatorelement,388preprocessing,101–121addingdebugcodeforloglevels,125avoidingproblems,121,305–307capabilities,51–52changingclassinheritance,119configuringapplications,74,119configuringpreprocessorextension,233usingcustompreprocessor,243custompreprocessor,creating,239–243definingsymbolsandvariables,114embeddedtranslationsafter,87hard-codedvalues,using,120J2MEapps.
onmultipledevices,102librariesusingoptional/device-specific,118parentlibraries,46reasonsfor,101–104reducingabstraction,330targetdevices,optimizing,51transformingvariableswithpropertyfunctions,117usingandavoidinginterfaceswith,330writingportablecode,298–300preprocessingdirectives,104–114,398–399booleanoperatorsforevaluatingterms,107hidingstatements,112include/excludeclasses/interfaces,109includingexternalcode,112Javalinecommentcharacters,104loggingframework,113nestingdirectives,114settingCSSstyles,113preprocessingphase,66analyzingpreprocessingphase,112buildphaseextensions,232preprocessingsymbolscheckingformultiple,106checkingforsingle,105configuringGUI,164defining/removing,109symbolelement,apis.
xml,45tablelisting,389–390using,114preprocessingvariablescomparingvariables,106,108comparingvariablesandconstants,107configurationvariables,392–397configuringGUI,164,166controllingGUI,161defining/removing,109device-specific,390–392includingvariablevaluesincode,110optimizinggameengine,146overridingattributevalues,74,353INDEX441settingvariablesfordevices,117specifyingattributes,74using,114usingseveralvariablevaluesindividually,111Preprocessorclassimplementing,239–243preprocessorelement,build.
xml,372–373attributes,tableof,372preverificationphase,68buildphaseextensions,232,245implementingcustompreverifier,245skippingtheobfuscationstep,245WIPIplatforms,294preverifierelement,build.
xml,380–381attributes,tableof,380printlnstatementviewingloggedmessages,123prioritylevel,messages,124problemsseetroubleshootingprofileattribute,infosection,364profilersenablingWTKprofiler,326profilesdifferencesbetweendevices,275–276differentiatingbetween,276J2MEprofiles,276Nokiadevices,285Siemensdevices,289SonyEricssondevices,291profilesproperty,MIDP,357programminggameprogramming,145–157progressindicatorsseeGaugeclass/itemsProGuardobfuscator,15,378combiningseveralobfuscators,95obfuscatingapplications,94projecttag,build.
xml,56projectsregisteringextensionsforseveralprojects,236propertiesBluetoothAPIproperties,358–359Mobile3DGraphicsAPI,359–360namingconventions,238retrievingfromastyle,259runtimeproperties,356–360systemproperties,356–358propertyfunctionsbuildphaseextensions,232creatingcustom,118,248extendingbuildphases,248tablelisting,399–400transformingvariableswith,117protocolshigh-levelperformancetuning,331–332publicaccessmodifierlow-levelperformancetuning,338pulsatingbackground,404–405pulsating-circlebackground,406pulsating-circlesbackground,407–408PushRegistrypermissionsforsignedMIDlets,361troubleshootingSiemensdevices,290Qquestionmarkattributenameendingwith,76quotationmarksescapingspecialcharactersintranslations,89RradioboxesexclusiveChoiceGroups,216radioboxavailabledynamicstyles,186radiobox-plainattribute,ChoiceGroups,217radiobox-selectedattribute,ChoiceGroups,217realdevicestrackingbugson,127trackingerrorson,128viewinglogonrealdevices,128–130RecordManagementSystemseeRMSrecordstoresfilteringandsorting,332–333creatingtemporaryobjectsby,332high-levelperformancetuning,332–334recordingproperty,MMAPI,357recursionmemoryconsumption,343reflectiondynamiccoding,295repeatattributeimagebackground,403pulsatingbackground,405repeat-animationattributedroppingview,208shuffleview,209repeatAnimationSpriteItemconstructor,179replacePropertiesWithoutDirectiveattributebuildelement,368requirementelement,deviceRequirements,365requirementelementscheckingcapabilities,83selectingdevicestobuildfor,81selectingtargetdevicestobuildfor,82resourceassembling,packagingphase,68–73automatic,303devicedatabase,50distinguishingbetweenformats,72–73finetuning,72–73filesetelement,73includinggroupspecificresources,70–71resourceselementcontrolling,381screensizes,274selectingandloadingresources,72solvingcommonproblems,303usinglocalespecificresources,72usingvendor/devicespecificresources,70INDEX442resourcecopierelementbuildphaseextensions,232resourcesdecreasingsizeof,349loadingarraydatafromresourcefile,348minimizingsizeofJARfiles,349–350readingincorrectly,304reading,usingdefensivetechniques,305reducing,349–350removing,350removingredundantinformation,349renaming,383Series40Nokiadevices,284solvingcommonproblems,303usingappropriateresources,349resourcesdirectorydirectoriesforspecificdevices,70groupspecificresources,70groupsforassemblingresources,70hierarchicalorderingofresources,72selectingresourcesfortargetdevices,50resourceselementcopyingandtransformingresources,245renamingresources,246resourceselement,build.
xml,381–382attributes,tableof,382resourcesfolder,16loadingimagesdynamically,261locales,85managingdatafilesin,69resourceassembling,68savingdefinitionfiles,141specifywhichfolderisusedas,69subdirectories,72switchingusedresources,168resources.
txtfiledefiningvariablesin,117resources2folder,16responsivenessimprovingperceivedperformance,340RetroGuardobfuscator,379returnstatementshidingstatements,preprocessing,112reusingobjectshigh-levelperformancetuning,331reverseengineeringobfuscation,67,94RGBdataportinglow-levelgraphicsoperations,152,153troubleshootingSonyEricssondevices,291RGBvaluedefiningcolors,195rightanimationscreenchangeanimations,229rightborder,415rightlayoutaligningitemswithlayoutattribute,193rightcommandstyle,204rightframestyle,185RightSoftKeyvariable,163,392RIMBlackBerrydeviceidentification,319vendorcharacteristics,291vendorforums,322RMS(RecordManagementSystem),418RMSloghandler,130RMSlogviewerfilteringmessages,131rootcertificates,318rootdirectory,15rotationandreflectionfunctionalityportinglow-levelgraphicsoperations,153round-rectbackground,401–402round-rectborder,413round-tabbackground,410–411runtimeproperties,356–360BluetoothAPIproperties,358–359Mobile3DGraphicsAPI,359–360systemproperties,356–358Ssampleapplications,15errormessages,17testing,16samplesdirectory,15Samsungvendorcharacteristics,288–289vendorforums,322vendor-specificemulators,10scale-factorattribute,listitems,213scale-stepsattribute,listitems,213scalingfunctionalityportinglow-levelgraphics,153Screenconstructorsstyledirectiveinsertionpoints,173screensizeNokiadevices,285Series40,284Series60,286Series80,287Series90,287Siemensdevices,289solvingcommonproblems,303SonyEricssondevices,290screen-change-animationattribute,229Series90Nokiadevices,287ScreenChangeAnimation,395ScreenHeight,392selectingtargetdevicestobuildfor,82screensarrangingitemson,206droppingview,208midp2view,209–210shuffleview,209usingtables,206–207designing,199–215Focuseditem,228forms,213FramedForms,214lists,211menus,200INDEX443menubars,200,202screenbackground,199scrollindicator,210TabbedForms,213TextBoxes,215titles,200foregroundimage,setting,210FullScreenpreprocessingvariable,166JTWIspecification,278programmingFramedForm,176resourceassembling,274screensused,281setScreenStateListenermethodFramedForm,177TabbedForm,174staticstyles,184usingGUIinfull-screenmode,163–164ScreenSize,392devicedatabase,42groupsforassemblingresources,71preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,82ScreenWidth,392selectingtargetdevicestobuildfor,82ScriptFileparameterDashOProobfuscator,380KlassMasterobfuscator,379scrollindicator,210settingcolorofscrollingindicator,213scrollablelistitem,248second-colorattributepulsating-circlesbackground,407securityseepermissionssecurityDomainattribute,emulatorelement,388Selectcommandvariable,166labelforSelectcommand,393localizingJ2MEPolishGUI,90select-imageattribute,menubar,204SelectionListenerImplementationusingandavoidinginterfaceswithpreprocessing,331selectorsCSSdeclaration,187serialconnectionspermissionsforsignedMIDlets,361Series40Nokiadevices,284,285DevelopmentPlatform2.
0,284Series60Nokiadevices,285,286activatingtheGUI,162FeaturePacks1,2,and3,286Series80Nokiadevices,285,287Series90Nokiadevices,285,287sessionsHTTPnetworking,312setmethodacceptingparametersinbuildextensions,233additionalTabbedFormmethods,174setFrameSequencemethodSpriteItem,178setFullScreenModemethod,Canvasclassavoidingknownissuesusingpreprocessing,305–306setParametersmethodacceptingparametersinbuildextensions,233configuringextensionwithconditionalparameters,234setScreenStateListenermethodadditionalFramedFormmethods,177additionalTabbedFormmethods,174setStylemethodintegratingCSSintocustomitems,259shadowborder,414sharedrecordstorelogviewerfinding,130shortdatatypeBinaryEditor,141shortmessageservice(SMS)networkingproblems,310show-image-and-textattribute,menubar,204show-lengthattribute,TextFields,225show-valueattribute,Gaugeclass,223showDecompiledStackTraceattributeemulatorelement,388showInputInfovariable,165,395showLogmethod,129showLogOnErrorattribute,debugelement,127,371showinglogautomatically,128shrinklayoutaligningitemswithlayoutattribute,193shuffleview,209Siemens55/65/75groups,289deviceidentification,318SX1,289vendorcharacteristics,289–290vendorforums,322vendor-specificemulators,10signelement,build.
xml,387attributes,tableof,387signingMIDlets,77signedMIDletspermissionsfor,360–362signingminimizingnumberoftargetdevices,84,318signingMIDlets,317SIM(SubscriberIdentityModule),418SIMcard,deviceidentification,318simplebackground,400–401simpleborder,412SIMPLEAPIoptionalpackagesforMIDPdevices,277SIPAPI(SessionInitiationAPI)optionalpackagesforMIDPdevices,277sizeattributeavailablefontattributes,196skipArgumentCheckvariable,164,394SMS(ShortMessageService),418permissionsforsignedMIDlets,361smscproperty,WMAPI,358INDEX444SOAPnetworkingissues,311softkeys,164dynamiccoding,297implementinglow-levelGUI,309usingcorrectkeycodesfor,309solutionelement,bugs.
xml,47SonyEricssonavoidingknownissuesusingpreprocessing,305deviceidentification,318vendorcharacteristics,290–291vendorforums,322vendor-specificemulators,10SoundFormat,392devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,83soundsplayingbackgroundmusicwithMMAPI,313solvingcommonproblems,313sourceattribute,compilerelement,375sourcecodeimplementingPreprocessorclass,241–243translatingintobinarybytecode,66sourcefileswritingportablecode,300–303sourceelement,sources,369attributes,tableof,369usingdifferentsourcefiles,300sourceDirattribute,buildelement,368integratingsourcecodethird-partyAPIs,92sourceDirvariable,398sourcepathattribute,compilerelement,375sourcepathrefattribute,compilerelement,375sourceselement,build.
xml,369attributes,tableof,369Spacerclassavailabledynamicstyles,186spacesavailabledynamicstyles,186speedattributedroppingview,208shuffleview,209splashscreenimprovingperceivedperformance,339splitImagevariable,TiledLayer,396Sprintcarriermodifications,292Spritetransformationsworkingaroundlimitationsofgameengine,151SpriteItemclassargumentsofSpriteItemconstructor,179availabledynamicstyles,186programmingSpriteItem,178–181setFrameSequencemethod,178spritesargumentsofSpriteItemconstructor,179device-specificpreprocessingsymbols,390troubleshootingSonyEricssondevices,291srcfolder,16srcdirattributecompilerelement,375buildelement,268SSLconnectionspermissionsforsignedMIDlets,361stacktraceloggingframeworkprinting,123–124stacktracesinemulators,124ofexceptions,124start-colorattributepulsatingbackground,405start-heightattributeopeningbackground,408opening-round-rectbackground,409statedetermininginternalapplicationstate,123statementshiding,112staticfinalvariablesJ2MEapps.
onmultipledevices,102staticmodifierusingaccessmodifiers,338staticstylesdesigningGUI,183–184dynamicstylescompared,64integratingCSSintocustomitems,256statuscodesinstallations,35stepattributepulsating-circlesbackground,407Tickers,227stepsattributeopeningbackground,408opening-round-rectbackground,409pulsatingbackground,405StorageSize,392devicedatabase,43preprocessingsymbolsandvariables,115streamable.
xyzpropertiessystemproperties,357StringentriesfieldimplementingStringListItemclass,255StringBuffersmemoryconsumption,344StringItemclassavailabledynamicstyles,186StringItemsdesigningStringItems,215StringListItemclasscreatingscrollablelistitem,248designingcustomitem,261stringscreatingunnecessary,343StringBufferreducingtemporaryobjects,343storingarraydatain,347stroke-styleattributecircleborder,416styleattributeavailablefontattributes,196INDEX445styledefinitiondesigningexclusiveChoiceGroups,217structureof,189–191styledirective,105,399applyingdesireddesignstyles,171designingChoiceGroups,216dynamicstyles,185insertionpointsfor,172settingCSSstyles,113specifyingstylesdirectlyforGUIitems,182staticstyles,184usingdynamicstyles,173stylesseealsoCSSstylesapplyingdesireddesignstyles,171basicstyledefinitioninresources/polish.
css,183designdefinitions,181designingGUIdynamic,static,andpredefinedstyles,183–186extendingstyles,182,187handlingcustomitems,256predefinedstyles,184programmingGUIsettingstyles,171–173dynamic,andpredefinedstyles,173retrievingapropertyfromastyle,259simplestyledefinition,182specifyingstylesdirectlyforGUIitems,182staticstyles,184supportAntialiasingproperty,M3GAPI,359supportDitheringproperty,M3GAPI,359supportLocalCameraLightingproperty,M3GAPI,360supportMipmappingproperty,M3GAPI,360supportPerspectiveCorrectionproperty,M3GAPI,360supports.
xyzpropertiessystemproperties,357supportsPolishGuiattributedeviceelement,42supportTrueColorproperty,M3GAPI,360suppressClearCommandvariable,165,395suppressCommandsvariable,165,395suppressDeleteCommandvariable,165,395suppressMarkCommandsvariable,165,392suppressSelectCommandsvariable,165,393SVGAPI(Scalable2DVectorGraphicsAPI)optionalpackagesforMIDPdevices,277switchstatementlow-levelperformancetuning,336–337SX1Siemensdevices,289Symbianvendor-specificemulators,10knowndeviceissuesavailablemethod,InputStream,304SymbianoperatingsystemMIDPplatforms,293symbolelement,apis.
xml,45symbolsdefining,114preprocessingsymbolscheckingformultiple,106checkingforsingle,105device-specific,389–390usingstandard,114setting,115symbolsforreadingcurrentsetting,397symbolsattribute,buildelement,368definingsymbols,115synchronizationArrayListclass,134usingaccessmodifiers,338SysInfoMIDlet,143testingcapabilitiesofdevices,143systemproperties,356–358assumingdefined,357System.
outstreamviewingloggedmessages,123TT-Mobilecarriermodifications,292tabbarstyledesigningTabbedForms,213predefinedstyles,184TabbedFormclassadditionalmethods,174availabledynamicstyles,186illustrated,176programmingTabbedForm,174–176using,174,214TabbedFormsdesigning,213tablesarrangingitemsonscreen,206–207attributesfortablearrangements,206targetattributecompilerelement,375copierelement,resources,384finalizerelement,387jadelement,386packagerelement,385postcompilerelement,376preprocessorelement,372preverifierelement,381targetdependencies,Ant,58targetdevicesseealsodevicesaddingattributeforcurrent,75adjustingJ2MEapps.
toworkonmultiple,101checkingcapabilitiesof,103device-specificpreprocessingsymbols,390informationaboutspecificdevices,49measuringperformanceon,327–329minimizingnumberof,83–84minimizingsizeofJARfiles,344–350optimizing,51optimizingapplications,325INDEX446selecting,49–50selectingdevicestobuildfor,80–83selectingforbuildphase,65–66selectingresourcesfor,50targetabledevices,66withintegratedcamera,273targetXMLattributespecifyingattributes,75targetsAnt,55build.
xmlfile,56invoking,57taskdefelement,build.
xmlbuildingaMIDlet,61integratingcustombackground,268tasksAnt,55build.
xmlfile,56TCPconnectionspermissionsforsignedMIDlets,361telecommarket,280–281mobilesalesEuropeanandworldwide,281tempdirattribute,compilerelement,375temporaryobjectscreatingbyfiltering/sortingrecordstore,332reducingnumberofobjects,342–343Termrequirementselectingtargetdevicestobuildfor,83testtargetactivating/deactivatingloggingframework,126testingtestingcapabilitiesofdevices,143testingphaseapplicationlifecycle,31–32textfittingtextwithindisplayarea,133paintingtext,137splittingtextintoStringarray,135wrappingtexttofitdisplayarea,133TextBoxclassavailabledynamicstyles,186TextBoxesdesigning,215usingcorrectimportstatements,171TextFieldclassavailabledynamicstyles,186configuring,167–168configuringTextFieldcommands,168configuringGUI,167–168preprocessingvariables,165–166TextFieldsadditionalattributesfor,224designing,224–226textsdynamicformpstyle,186TextUtilclass,135–136fittingtextwithindisplayarea,133wrappingtexttofitdisplayarea,133third-partyAPIs,92–94third-partypackagers,78–80thiskeywordnamingconventions,21threadsDoJaplatforms,294high-levelperformancetuning,331JTWIspecification,278synchronizingArrayListclass,134Tickersadditionalattributefor,227designingTickers,227–228TiledLayerbackbufferoptimization,148–149definingGridTypeofaTiledLayer,149splittingimageintosingletiles,149timezonesJTWIspecification,278timeoutsInputTimeoutpreprocessingsymbol,165TinyLineintegratingbinarythird-partyAPIs,93titlestyle,184titlesdesigningtitles,200inputpreprocessingvariable,166usingtextofcurrentlyfocusedlistitemas,211–212TLSconnectionspermissionsforsignedMIDlets,361tododirective,105,399analyzingpreprocessingphase,112toolsinstalling,15stand-alonetools,30topanimationscreenchangeanimations,229topborder,415toplayoutaligningitemswithlayoutattribute,193topframestyle,185traceattribute,emulatorelement,388translationsdefiningtranslations,87–88inresources/messages.
txt,86embeddedafterpreprocessing,87escapingspecialcharactersin,89insertinginapplication,86–87localizingJ2MEPolishGUI,91managing,85–88settinglocalizedvariables,88usinglocalizedattributes,88translucentbackgroundsportinglow-levelgraphicsoperations,153usingforcurrentlyfocuseditem,401transparentcoloralphablending,195designingnormalmenubar,202predefinedcolors,194TransparentTileColorvariable,396activatingbackbufferoptimization,149INDEX447traversemethodhandlingcustomitems,256implementingStringListItemclass,255troubleshootingavoidingknownissues,304–308avoidingproblems,121commonproblems,303–321defensiveprogramming,304–305deviceidentification,318–321floating-pointcalculations,314–317gettinghelp,321–322LGElectronicsdevices,290Motoroladevices,287networking,310–312Nokiadevices,284,286Samsungdevices,288Siemensdevices,290SonyEricssondevices,291sounds,313–314trustedMIDlets,317–318userinterface,308–310usingappropriateresources,303TrueTypefontconvertingintobitmapfont,142TrueTonessoundportingsoundplayback,155trustedapplications,77trustedMIDletspermissions,317signingMIDlets,317solvingcommonproblems,317typeattributecirclebackground,404circleborder,416imagebackground,402openingbackground,408opening-round-rectbackground,409pulsating-circlebackground,406pulsating-circlesbackground,407registeringcustomCSSattributes,260round-rectbackground,401round-rectborder,413round-tabbackground,410shadowborder,414simplebackground,400top,bottom,left,andrightborders,415typeattribute,requirementelement,365checkingcapabilities,83pulsatingbackground,405typeelementregisteringextensionsforseveralprojects,236UUMBAAPI(UnifiedMessageBoxAccessAPI)optionalpackagesforMIDPdevices,278UMTS(UniversalMobileTelephoneSystem),418undefinedirective,105,399defining/removingsymbols/variables,109unlessattributeaddingattributeforcurrenttargetdevices,75applyingfilterforspecificdevices,76compilerelement,375copierelement,resources,384debugelement,127–128,371deviceRequirementselement,365emulatorelement,388filesetelement,resources,382finalizerelement,387jadelement,386localizationelement,resources,383midletelement,370obfuscatorelement,377packagerelement,385parameterelement,233parameterelement,emulator,389postcompilerelement,376preprocessorelement,373preverifierelement,381selectingdevicestobuildfor,81signelement,387sourceelement,sources,369sourceselement,369variableelement,371Unmarkcommandvariable,166labelforunmarkcommand,393localizingJ2MEPolishGUI,90unsignedbytedatatypeBinaryEditor,141unsignedshortdatatypeBinaryEditor,141untrustedapplications,77UPDdatagramspermissionsforsignedMIDlets,360updatingapplication,36uppercasepropertyfunction,400transformingvariableswith,118useBackBuffervariable,396useDefaultPackageattributeobfuscatingapplications,95,377useDirectInputvariable,165,395configuringtheTextField,168useExtendedMenuBarvariable,394designingextendedmenubar,203useFull-screenvariable,GameCanvas,394usePolishGameApivariable,397usinggameengineforMIDP2.
0devices,150usePolishGuiattribute,buildelement,42,368activatingtheGUI,161–162usePolishGuivariable,166,397usePolishTitlevariable,397userinput,evaluationoflimitationsofgameengine,150userinterfacesseealsointerfaces;J2MEPolishGUIproblemsimplementinguserinterface,308user-definedattributesconfiguringapplication,74INDEX448user-definedloglevels,127UTF-StringdatatypeBinaryEditor,141utilities,138–143BinaryEditor,139–141FontEditor,142–143SysInfoMIDlet,143utilityclasses,133–138ArrayListclass,134–135BitMapFontclass,136–138BitMapFontViewerclass,136Debugclass,138DeviceControlclass,138Localeclass,138obfuscatorremovingunusedclasses,133TextUtilclass,135–136Vvalueattributecompilerargselement,376jadelement,386parameterelements,233parameterelement,emulator,389parameterelement,obfuscator,378requirementelement,365variableelement,370value-alignattribute,Gaugeclass,223valuesusinghard-codedvalues,120valuesattributeregisteringcustomCSSattributes,260variableelement,build.
xml,370–371attributes,tableof,370definingsymbolsandvariables,116variablescomparing,108configurationvariables,392–397defining,114device-specificpreprocessingvariables,390–392functionstransformingvariablevalues,399–400includingvaluesofpreprocessingvariablesincode,110retrievingnumberofseparatevalueswithin,111setting,115transformingwithpropertyfunctions,117usingseveralvariablevaluesindividually,111usingstandardpreprocessingvariables,114variablesforreadingcurrentsetting,398variableselement,build.
xml,370–371definingvariables,115localizingJ2MEPolishGUI,91vcenterlayoutaligningitemswithlayoutattribute,193Vectorclass,133vendorcertificates,318vendorelement,vendors.
xml,44Vendorrequirementselectingtargetdevicestobuildfor,83vendor-specificemulators,9Vendorvariable,392vendorNameattribute,infosection,364vendorsdirectoriesforspecificvendors,70mobiledevicemanufacturers,281vendor-specificattributes,355vendorsattribute,buildelement,369vendorselement,vendors.
xml,44vendors.
xml,44definingcapabilitiesandfeatures,48definingNokiaandSiemensin,44definingsupportedlibraries,45devicedatabasefile,39verboseattributecompilerelement,375debugelement,127,371verbosedebuggingmodeexceptions,124verificationJavaVerifiedinitiative,318versionattribute,infosection,364versioncontrolsystemsintegratingJ2MEPolishintoIDEs,19VersionparameterDashOProobfuscator,380versionpropertyJTWI,357LocationAPI,357M3G,357MMAPI,357PDAAPI,358SensorAPI,358vexpandlayoutaligningitemswithlayoutattribute,193Vibratefunctionalitydevicecontrol,156videodevice-specificpreprocessingsymbols,390video.
xyzproperties,358VideoFormat,392devicedatabase,43preprocessingsymbolsandvariables,115selectingtargetdevicestobuildfor,83viewtypesarrangingitemsonscreen,206usingwithcolumnsattribute,207viewwindowSiemensdevices,290view-typeattribute,ChoiceGroups,216,217arrangingitemsonscreen,206viewerclassBitMapFontViewerclass,136Vodafonecarriermodifications,292vendor-specificattributes,356vshrinklayoutaligningitemswithlayoutattribute,193INDEX449WWAAPI(WebServicesAPI)optionalpackagesforMIDPdevices,277waitattribute,emulatorelement,388WAP(WirelessApplicationProtocol),418WAPgatewaynetworkingproblems,311wavgroupassemblingresources,71webserverImageLoadergettingimagesfrom,262WEME(WebSphereEveryplaceMicroEnvironment)virtualmachine,293widthattributecircleborder,416DateFields,226Gaugeitems,223round-rectborder,413shadowborder,414simpleborder,412TextFields,224top,bottom,left,andrightborders,415WIPI(WirelessInternetPlatformforInteroperability),294wirelessgamingmarket,282WirelessMarkupLanguage(WML)deploymentphase,33WirelessToolkitseeWTKwireless.
xyzproperties,358WMAPI(WirelessMessagingAPI)optionalpackagesforMIDPdevices,276–277WML(WirelessMarkupLanguage),418workDirattribute,buildelement,369setting,128wrapperclassesusinggameengine,146wrappingtextsplittingtextintoStringarray,135TextUtilclass,133write-oncecapabilityAntproperties,57WTK(WirelessToolkit)forMacOSX,8installing,8selectinginstallationdirectory,12versions,8WTKemulatormeasuringmemoryconsumption,341measuringperformance,326–327runningJ2MEPolish,4Xxattribute,foregroundimage,210XMLformatbuild.
xmlfile,58devicedatabase,39–49changingandextending,52XMLprotocolnetworkingissues,311xor(^)operatorbooleanoperatorsforevaluatingterms,107xornestedelementdeviceRequirementselement,365Yyattribute,foregroundimage,210yguardAnttaskobfuscatingapplication,237yGuardobfuscator,379ZzoomInAndHide/zoomOutanimationsscreenchangeanimations,229INDEX450

弘速云香港VPSVPS线路有CN2+BGP、CN2 GIA,KVM虚拟化架构,裸金属月付564元

弘速云怎么样?弘速云是创建于2021年的品牌,运营该品牌的公司HOSU LIMITED(中文名称弘速科技有限公司)公司成立于2021年国内公司注册于2019年。HOSU LIMITED主要从事出售香港vps、美国VPS、香港独立服务器、香港站群服务器等,目前在售VPS线路有CN2+BGP、CN2 GIA,该公司旗下产品均采用KVM虚拟化架构。可联系商家代安装iso系统。点击进入:弘速云官方网站地址...

QQ防红跳转短网址生成网站源码(91she完整源码)

使用此源码可以生成QQ自动跳转到浏览器的短链接,无视QQ报毒,任意网址均可生成。新版特色:全新界面,网站背景图采用Bing随机壁纸支持生成多种短链接兼容电脑和手机页面生成网址记录功能,域名黑名单功能网站后台可管理数据安装说明:由于此版本增加了记录和黑名单功能,所以用到了数据库。安装方法为修改config.php里面的数据库信息,导入install.sql到数据库。...

819云互联 香港 日本 美国 2核4G 18元 8核8G 39元 免费空间 免费CDN 香港 E3 16G 20M 230元/月

819云互联是海外领先的互联网业务平台服务提供商。专注为用户提供低价高性能云计算产品,致力于云计算应用的易用性开发,并引导云计算在国内普及。目前平台研发以及运营云服务基础设施服务平台(IaaS),面向全球客户提供基于云计算的IT解决方案与客户服务,拥有丰富的海外资源、香港,日本,美国等各国优质的IDC资源。官方网站:https://www.819yun.com香港特价物理服务器:地区CPU内存带宽...

字节跳动回应TikTok易主为你推荐
支持ipad企业cmscms系统的概念是什么iprouteip route-static 192.168.1.0 255.255.255.0 3.3.3.2什么意思德国iphone禁售令苹果手机禁售了 我想问问 这两天刚买的8p现在禁售了 我是赔手里了还是没啥事 是幸运的还是倒霉的cisco2960配置思科2960G交换机如何将配置百兆改为千兆配置163yeah请问网易的163,126,yeah,VIP,188邮箱各有什么特点?360防火墙在哪里电脑或电脑360有联网防火墙吗,在哪里设置sns网站有哪些最近两年哪些SNS网站比较火台北市cuteftp爱买网超谁有http://www.25j58.com爱网购吧网站简介?
西安服务器租用 国际域名抢注 美国vps 域名解析服务器 科迈动态域名 host1plus simcentric 狗爹 优key 特价空间 evssl 好看的桌面背景图 php空间申请 dux 免费美国空间 免费智能解析 酷番云 linux使用教程 万网主机管理 东莞主机托管 更多