Building Mobile Enterprise Applications : Using webMethods Mobile Designer : 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.display.scaling.percent
The System.getProperty method returns a percentage value that you can use to determine the physical size of a screen.
Some Windows devices provide a virtual screen size that is not equal to the number of physical pixels in the device's display. In this case, the operating system automatically scales the content to fit. Use this property to obtain a percentage value that indicates the scaling factor to apply to the device's reported width and height values to get the actual physical size of the screen in pixels.
This property is supported for Windows 8, Windows RT, and Windows Phone 8.
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”, “iOS”, or “WinPhone”.
If you are running the application in Phoney, the System.getProperty method returns the name of the platform you are simulating in Phoney.
mobiledesigner.device.push.id
If the application is set up to use Push Notifications, then at application start, the runtime will ask the handset's operating system to give a unique ID that can be used to identify this phone and register it with a server for push notifications. The String returned for mobiledesigner.device.push.id will be an appropriate representation of that unique ID. If an error has occurred, or push notification is not enabled, this value will be null.
mobiledesigner.device.push.error
If the application encounters an error when attempting to get the unique ID for mobiledesigner.device.push.id on startup, the handset's OS may return one or more error messages. In this case, mobiledesigner.device.push.error will be populated with the last error message returned. These will likely be of a technical nature, and may or may not be localised for the user's current language, depending on the handset's OS.
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.
Copyright © 2007-2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback