MIDlet Properties

MIDlet Properties

The mplayit widget interprets the usual MIDlet properties in the expected manner, and also introduces a number of custom properties that can appear in either the JAR’s manifest or in the JAD file.

Display properties

MPP-Width: Sets the initial width of the midlet content area, before scaling. The default is subject to change.

MPP-Height: Sets the initial height of the midlet content area, before scaling. The default is subject to change.

MPP-Resize: Sets whether the midlet is allowed to resize. Depending on the MicroEdition-Profile property, this property defaults to "false" for MIDP 1.x and "true" for MIDP 2.x.

MPP-Scale: Specifies a scaling factor to apply to the midlet. The default is "2.0".

MPP-Antialias: Controls whether antialiasing is used to for primitive drawing commands (lines and fonts). Default is "true".

MPP-Font-Monospace: Replaces the platform’s standard monospace font with the font you specify in standard java notation, e.g. "FontName-12". MPP automatically maps the large size as 150% and the small size as 75% of what you specify.

MPP-Font-Proportional: Replaces the platform’s standard proportional font with the font you specify in standard java notation, e.g. "FontName-12". MPP automatically maps the large size as 150% and the small size as 75% of what you specify.

MPP-FPS-Cap: Since our repaint loop is faster than many devices, this property regulates the number of times the screen is able to repaint itself.  If you don’t use a timer-based run loop, you’re going to need this.  Default is no capping.

MPP-FPS-Lag: Yields the the thread for a certain number of milliseconds. Some applications have a “game thread” that isn’t regulated. With desktop processor speeds, this can cause erratic behavior. Worse, it can consume all available processing power, causing other applications to freeze (esp. on windows). Specifying a lag does help in these situations, though in some situations, setting it to zero will increase performance. The default value is 30.

MPP-Suppress-Service-Repaints:  Setting this property to "true" causes the serviceRepaints() method of the Canvas class to not paint immediately.  Some apps works better when the service repaints request is suppressed. Default is "false".

Input properties

MPP-Show-Keypad: Indicates whether the keypad panel should be shown or not.  The valid values are “true” and “false”.  If this property and preference is not set, then it defaults to “false”.

MPP-Invert-Keypad: Inverts the keypad keys so 7, 8, and 9 map to 1, 2, and 3, and vice versa. Default is "true".

MPP-Keypad-Mapping: Determines the mapping of the keypad.  If set to “navpad-to-numpad” then the navpad (arrow keys) are mapped to the numpad keys and act just like numpad keys to the MIDlet.  If set to “numpad-to-navpad” then the numpad keys are mapped to the navpad keys and act just like the navpad keys (arrow keys) to the MIDlet.  If set to nothing or anything else then no mapping occurs (default behavior).

MPP-Enable-Mouse-Events: Determines whether the mouse cursor is enabled when over a Canvas.  Because most MIDlets don’t handle pointer events on a Canvas, the default is “false”.  Note that in both cases, pointer events are still delivered to the canvas.

Sidebar properties

MPP-Info-URL-Label: The label that will be used on the side panel when displaying the MIDlet’s Info URL (as defined in the manifest or jad file).  The default label is “More Information:”.

MPP-Required-Version: This property specifies the minimum required version of the mplayit widget that is necessary to run this MIDlet. The value should be a integer value that specifies a valid mplayit widget build number, like “373” or “401”.  If the user’s version is less than the specified value, they will be prompted to restart the mplayit widget to update to the latest version.

MPP-Handango-Product-ID: When specified with a comma-delimited list of handango product ID for your product, a “Buy Now” button appears and the user can transact the sale completely from within the player application. 

Demonstration properties

mplayit allows you enormous flexibility to securely demonstrate your mobile applications.  You can limit the duration or functionality with no changes to your code and without requiring a separate “demo” codebase.

Because these properties appear in the jad or manifest, you’ll probably want to encrypt your application using the protector tool in the free mplayit developer kit.

MPP-Demo-Duration: specifies the amount of time a demo app can be run for (in whole seconds). If the number is without a modifying tag, then each time the app is run, the full amount of time will be used (each time the app is loaded). If the modifying tag "t" is appended to the value, then this specified the total amount of time a demo app can be run across invocations of mpp.
Example:
MPP-Demo-Duration: 1200t

MPP-Demo-Number-Of-Uses: The number of times a demo MIDlet app may be run (used).  If this value is not set or is 0 or less, then there is no limit to the number of times a MIDlet app may be run.  Any value greater than 0 specified the number of times that a MIDlet may be run before it expires.

MPP-Demo-Over-Message: The message presented to the user when the "demo over" screen is displayed. The message can use HTML markup. The message can also contain a special tag, <appProp>, to to signify one of the MIDlet’s application properties from the jad or manifest file.
Example: <center>Thanks for playing <appProp>MIDlet-Name</appProp>, ver. <appProp>MIDlet-Version</appProp></center>

MPP-Demo-Tokens: The number of tokens used for demos that can be adjusted by the demo MIDlet itself using the platformRequest() method with an URL starting with “mppdemo://”.  When the number of tokens have been decreased to zero, then the demo is over and the MIDlet is stopped.  If this value is not set or is 0 or less, then the demo token feature is not used.  Any value greater than 0 specifies the initial number of demo tokens.
NOTE: The token value specifies the value for each run of the MIDlet application.  To use the token value across all runs of an app, append “t” after the value (total tokens). Mpp will keep track of the tokens across all runs.
Example:
    MPP-Demo-Tokens: 10    
    MPP-Demo-Tokens: 25t    

mppdemo://useToken
number of demo tokens should be decreased (used).  If no value is specified, then the token number is decreased by 1.  If a value is specified, then the token number is decreased by that amount.  To specify a value the parameter should be followed by an equal sign, “=”, and a whole positive number.
Example:
platformRequest( “mppdemo://useToken” );
platformRequest( “mppdemo://useToken=2” );

mppdemo://addToken
number of demo tokens should be increased (add).  If no value is specified, then the token number is increased by 1.  If a value is specified, then the token number is increased by that amount.  To specify a value the parameter should be followed by an equal sign, “=”, and a whole positive number.
Example:
platformRequest( “mppdemo://addToken” );
platformRequest( “mppdemo://addToken=2” );

mppdemo://setTokens
sets this MIDlet’s number of demo tokens.  The value should be followed by an equal sign, “=”, and a whole positive number specifiying the number of demo tokens.
Example:
platformRequest( “mppdemo://setTokens=5” );

 

 

Quick Contact