1# @system.device (Device Information)
2
3The **device** module provides APIs for checking information about the current device.
4
5> **NOTE**
6>
7> - The APIs of this module are no longer maintained since API version 6. It is recommended that you use [`@ohos.deviceInfo`](js-apis-device-info.md).
8>
9> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
10
11## Modules to Import
12
13```typescript
14import device from '@system.device';
15```
16
17## device.getInfo<sup>(deprecated)</sup>
18
19getInfo(options?: GetDeviceOptions): void
20
21Obtains the device information.
22
23> **NOTE**<br>
24> Do not call **device.getInfo** before the **onShow** event of the home page.
25
26**System capability**: SystemCapability.Startup.SystemInfo.Lite
27
28**Parameters**
29
30| Name| Type| Mandatory| Description|
31| -------- | -------- | -------- | -------- |
32| options | [GetDeviceOptions](#getdeviceoptionsdeprecated) | No| Parameters for obtaining the device information.|
33
34## GetDeviceOptions<sup>(deprecated)</sup>
35
36Defines the parameters for obtaining the device information.
37
38**System capability**: SystemCapability.Startup.SystemInfo.Lite
39
40| Name| Type| Mandatory| Description|
41| -------- | -------- | -------- | -------- |
42| success | (data: DeviceResponse)=> void| No| Called when an API call is successful. **data** indicates the returned device information. For details, see [DeviceResponse](#deviceresponsedeprecated).|
43| fail | (data: any,code:number)=> void| No| Called when an API call has failed. **code** indicates the error code returned upon a failure.<br>**code:200**: Certain information could not be obtained.|
44| complete | () => void| No| Called when an API call is complete.|
45
46## DeviceResponse<sup>(deprecated)</sup>
47
48Defines the device information.
49
50**System capability**: SystemCapability.Startup.SystemInfo.Lite
51
52| Name| Type| Description|
53| -------- | -------- | -------- |
54| brand | string | Brand.|
55| manufacturer | string | Manufacturer.|
56| model | string | Model.|
57| product | string | Product number.|
58| language<sup>4+</sup> | string | System language.|
59| region<sup>4+</sup> | string | System region.|
60| windowWidth | number | Window width.|
61| windowHeight | number | Window height.|
62| screenDensity<sup>4+</sup> | number | Screen density.|
63| screenShape<sup>4+</sup> | string | Screen shape. The options are as follows:<br>- **rect**: rectangular screen<br>- **circle**: round screen|
64| apiVersion<sup>4+</sup> | number | API version.|
65| deviceType<sup>4+</sup> | string | Device type.|
66
67
68**Example**
69
70```typescript
71export default {
72  getInfo() {
73    device.getInfo({
74      success: function(data) {
75        console.log('Device information obtained successfully. Device brand:' + data.brand);
76      },
77      fail: function(data, code) {
78        console.log('Failed to obtain device information. Error code:'+ code + '; Error information: ' + data);
79      },
80    });
81  },
82}
83```
84