Device functionality allows you to retrieve information about the device.
There are many pieces of information available through the Device interface that allow you to determine what device you are currently running on, including things like the operating system version and the device model.
trace( "DEVICE INFO ============================" ); trace( " name: " + Application.service.device.name ); trace( " brand: " + Application.service.device.brand ); trace( " manufacturer: " + Application.service.device.manufacturer ); trace( " device: " + Application.service.device.device ); trace( " model: " + Application.service.device.model ); trace( " yearClass: " + Application.service.device.yearClass ); trace( " product: " + Application.service.device.product );
The device locale settings can be retrieved through the
var locale:Locale = Application.service.device.locale
This object contains information about the device locale:
locale.country: The country/region code for this locale, which should either be the empty string, an uppercase ISO 3166 2-letter code, or a UN M.49 3-digit code;
locale.language: The language code of this Locale, or the empty string if none is defined
The functionality also includes some access to some system dependant paths,
such as the
getFilesDir on Android.
trace( "PATHS ==================================" ); trace( "files dir: " + Application.service.device.getFilesDir() );
You can access information about the current system time zone on the device using the
var timezone:TimeZone = Application.service.device.localTimeZone;
TimeZone class represents a time zone offset indicating the standard time policies for a geopolitical region.
Time zones have identifiers like
"America/Los_Angeles" which can be accessed through the
var timezoneId:String = Application.service.device.localTimeZone.id;
You can also access the offset from UTC using the
utcOffset property. This gives you the amount of time in milliseconds to add to UTC to get standard time in this time zone.
var utcOffset:Number = Application.service.device.localTimeZone.utcOffset;
|!(Year Class||u.Device Information - Year Class)|
|!(Phone Number||u.Device Information - Phone Number)|
|!(Operating System||u.Device Information - Operating System)|
|!(Device State||u.Device Information - Device State)|
|!(Display Metrics||u.Device Information - Display Metrics)|
|!(Device Orientation||u.Device Information - Orientation Events)|