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) instead. 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 18 19getInfo(options?: GetDeviceOptions): void 20 21Obtains the device information. 22 23> **NOTE** 24> 25> Do not call **device.getInfo** before the **onShow** event of the home page. 26 27**System capability**: SystemCapability.Startup.SystemInfo.Lite 28 29**Parameters** 30 31| Name| Type| Mandatory| Description| 32| -------- | -------- | -------- | -------- | 33| options | [GetDeviceOptions](#getdeviceoptions) | No| Parameters for obtaining the device information.| 34 35## GetDeviceOptions 36 37Defines the parameters for obtaining the device information. 38 39**System capability**: SystemCapability.Startup.SystemInfo.Lite 40 41| Name| Type| Mandatory| Description| 42| -------- | -------- | -------- | -------- | 43| success | (data: DeviceResponse)=> void| No| Called when API call is successful. **data** indicates the returned device information. For details, see [DeviceResponse](#deviceresponse).| 44| fail | (data: any,code:number)=> void| No| Called when API call has failed. **code** indicates the error code returned upon a failure.<br>**code:200**: Certain information could not be obtained.| 45| complete | () => void| No| Called when API call is complete.| 46 47## DeviceResponse 48 49Provides the device information. 50 51**System capability**: SystemCapability.Startup.SystemInfo.Lite 52 53| Name| Type| Description| 54| -------- | -------- | -------- | 55| brand | string | Brand.| 56| manufacturer | string | Manufacturer.| 57| model | string | Model.| 58| product | string | Product number.| 59| language<sup>4+</sup> | string | System language.| 60| region<sup>4+</sup> | string | System region.| 61| windowWidth | number | Window width.| 62| windowHeight | number | Window height.| 63| screenDensity<sup>4+</sup> | number | Screen density.| 64| screenShape<sup>4+</sup> | string | Screen shape. The options are as follows:<br>- **rect**: rectangular screen<br>- **circle**: round screen| 65| apiVersion<sup>4+</sup> | number | API version.| 66| deviceType<sup>4+</sup> | string | Device type.| 67 68 69**Example** 70 71```typescript 72export default { 73 getInfo() { 74 device.getInfo({ 75 success: function(data) { 76 console.log('Device information obtained successfully. Device brand:' + data.brand); 77 }, 78 fail: function(data, code) { 79 console.log('Failed to obtain device information. Error code:'+ code + '; Error information: ' + data); 80 }, 81 }); 82 }, 83} 84``` 85