devices Methods

This section describes the members used to manipulate the object.

current()

Returns information about the current device.

Return Value: Object
An object containing information about the current device.

The returned object contains the following Boolean fields, which indicate whether or not the device is of a certain type: phone, tablet, android, ios, win8, tizen and the platform string field, which indicates the current platform ("android", "win8", "ios" or "tizen").

Show Example:
jQuery
<div data-bind="dxButton: {text: 'Get Platform', clickAction: getPlatform}"></div>
<div class="dx-fieldset">
    <div class="dx-field">
        <div class="dx-field-label">Platform</div>
        <div class="dx-field-value" data-bind="text: platformName"></div>
    </div>
</div>
platformName = ko.observable("undefined");
getPlatform = function () {
  platformName(DevExpress.devices.current().platform);
};
body {
    text-align: center;
}
.button{
    margin-top: 25px;
}

current(deviceName)

Overrides the actual device information to force the application to operate as if it were running on the specified device.

Parameters:
deviceName: String
The required device name. The parameter can take one of the following values: "iPhone", "iPhone5", "iPad", "iPadMini", "androidPhone", "androidTablet", "win8", "win8Phone", "msSurface", "desktop" and "tizen".

The returned object contains the following Boolean fields, which indicate if the device is of a certain type: phone, tablet, android, ios, win8, tizen and the platform string field, indicating the current platform ("android", "win8", "ios" or "tizen").

Show Example:
jQuery
<div data-bind="dxButton: {text: 'Get Platform', clickAction: getPlatform}"></div>
<div class="dx-fieldset">
    <div class="dx-field">
        <div class="dx-field-label">Platform</div>
        <div class="dx-field-value" data-bind="text: platformName"></div>
    </div>
</div>
DevExpress.devices.current("iPhone");
platformName = ko.observable("undefined");
getPlatform = function () {
  platformName(DevExpress.devices.current().platform);
};
body {
    text-align: center;
}
.button{
    margin-top: 25px;
}