Mobile Development 10.11 | webMethods Mobile SuiteWeb Help | Using webMethods Mobile Designer | Creating Mobile Application Projects | Coding a Mobile Application | Using System.getProperty to Obtain Device Information
 
Using System.getProperty to Obtain Device Information
You can use the Java System.getProperty(String) method to return system information for the device on which your application is running. The table below lists properties that you might find useful.
When invoking the Java method, supply the property name as the String input variable. For example, if you want to use the mobiledesigner.device.name property, invoke the following:
System.getProperty("mobiledesigner.device.name")
Property and Description
mobiledesigner.device.firmware
The System.getProperty method returns information that identifies the firmware of the device.
If you are running the application in Phoney, the System.getProperty method returns the full Mobile Designer version number including the build number, for example, “9.5.1.2.344”.
mobiledesigner.device.name
The System.getProperty method returns information that identifies the device hardware, for example, “iPhone4S”.
If you are running the application in Phoney, the System.getProperty method returns “Phoney”.
mobiledesigner.device.uid
The System.getProperty method returns information that uniquely identifies the specific device on which the application is running. This is typically a unique String.
mobiledesigner.display.ppi
The System.getProperty method returns the resolution of the device’s screen in pixels per inch, for example, “240”.
mobiledesigner.domain.availability:domain_name
The System.getProperty method returns whether the device can connect to the domain specified by domain_name . For example, if you want to determine whether the device can connect to www.softwareag.com, use mobiledesigner.domain.availability:www.softwareag.com.
The return values are one of the following:
*true if the device can connect.
*false if the device cannot connect.
mobiledesigner.locale
The System.getProperty method returns the language the device is currently configured to use. The language is returned in the following format:
language_COUNTRY
where:
*language is the two-character, lowercase language code defined by ISO 639.
*COUNTRY is the two-character, uppercase country code defined by ISO3166.
Note:
In some circumstances, the country code might not be returned, for example, if the device does not grant access to the country information. In these circumstances, only the two-letter language code is returned, for example, “en”.
mobiledesigner.online.availability
The System.getProperty method returns whether the device is connected to a network. The returned information is one of the following:
*If the device is not connected to a network, the method returns false.
*If the device is connected to a network, the return information is in the following format:
true:method
For example, if the device is connected to WiFi, the return information is “true:wifi”.
If the network interface details are not specified, method is “unknown”, for example, “true:unknown”.
mobiledesigner.platform
The System.getProperty method returns the platform for the device. The platform name that the System.getProperty method returns matches how Mobile Designer lists platforms, for example, “Android” or “iOS”.
If you are running the application in Phoney, the System.getProperty method returns the name of the platform you are simulating in Phoney.
mobiledesigner.android.display.dpi.class
Provides a DPI value based on the screen's display class. This will not follow the exact DPI of the device, but will give a value equivalent to a typical device in this class, be it low, medium, high, xhigh, etc. density. The values returned are based on the scaling factor given in Android's DisplayMetrics.density as applied to a 160 DPI screen. So, a device with relatively high DPI may have a DisplayMetrics.density value of 2.5, and therefore return a value of 400 (160 *2.5) for the DPI class.
mobiledesigner.android.display.capabilities
Will output a String enumerating some of the capabilities for the device. For now, the expected format of this String is screenlayout_size_category|display_is_long. This String may expand to include more data later, and will continue to use the pipe character ("|") as a separator between fields. The values returned are based on information obtained from the android.content.res.Configuration class. For the screenlayout_size_category, current possible return values are SIZE_SMALL, SIZE_NORMAL, SIZE_LARGE, SIZE_XLARGE and SIZE_UNKNOWN. For the display_is_long category, possible return values are LONG_YES, LONG_NO and LONG_UNDEFINED. A typical handset may return SIZE_XLARGE|LONG_YES.