Building Mobile Enterprise Applications : Using webMethods Mobile Designer : Setting Properties and Parameters for a Mobile Application Project : Using Parameters in Your Application Code
Using Parameters in Your Application Code
When creating an application, typically you have common logic that works for all target devices. However, you might require branches in the logic to address the needs of a specific target device. For example, you might need to omit or alter a feature for a target device, or you might need to position an image relative to the screen dimensions for a target device. To accommodate device-specific logic, your application logic can branch based on parameter values that are set using the device profile settings.
To use parameters in your application code, import the com.software.mobile.runtime.Parameters class. You can then easily access parameter values. For example, if you want to branch logic based on an application-specific “PARAM_DISPLAY_SPLASH_SCREEN” parameter, you can use a statement like the following:
if (Parameters.PARAM_DISPLAY_SPLASH_SCREEN)
You also use parameters that define identifiers for resources and resource blocks to load resources and resource blocks into memory, and unload them from memory, as necessary.
ResourceHandler.instance.loadResourceBlock (Parameters.RESBLOCKID_SPLASHES);
 
splash_screen_image_id = ImageHandler.instance.loadImageID
(Parameters.RESID_SPLASH_SCREEN_IMAGE, -1, -1, false);
 
ResourceHandler.instance.unloadResourceBlock (Parameters.RESBLOCKID_SPLASHES);
For more examples about how to use the parameters in application code, review the code provided with sample projects that are provided with Mobile Designer.
Copyright © 2007-2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback