1# Device Information 2 3> **NOTE** 4> - 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. 5> 6> - 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. 7 8 9## Modules to Import 10 11 12``` 13import device from '@system.device'; 14``` 15 16 17## device.getInfo 18 19getInfo(Object): void 20 21Obtains the device information. 22 23>  **Note:** 24> Do not call **device.getInfo** before the **onShow** event of the home page. 25 26**System capability**: SystemCapability.Startup.SysInfo 27 28**Parameters** 29 30| Name | Type | Mandatory | Description | 31| -------- | -------- | -------- | -------- | 32| success | Function | No | Called when the device information is obtained | 33| fail | Function | No | Called when the device information fails to be obtained | 34| complete | Function | No | Called when the execution is complete | 35 36The following values will be returned when the device information is obtained. 37 38| Name | Type | Description | 39| -------- | -------- | -------- | 40| brand | string | Brand | 41| manufacturer | string | Manufacturer | 42| model | string | Model | 43| product | string | Product number | 44| language<sup>4+</sup> | string | System language | 45| region<sup>4+</sup> | string | System region | 46| windowWidth | number | Window width | 47| windowHeight | number | Window height | 48| screenDensity<sup>4+</sup> | number | Screen density | 49| screenShape<sup>4+</sup> | string | Screen shape. The options are as follows:<br/>- rect: rectangle screen<br/>- circle: circle screen | 50| apiVersion<sup>4+</sup> | number | API version | 51| releaseType<sup>4+</sup> | string | Release type. The value includes both the release type and the API version, for example, Beta1.<br/>Available release types are as follows:<br/>- **Canary**: For the same API version, different canary releases are compatible with each other, but not compatible with those of the **beta** and **release** type.<br/>- **Beta**: For the same API version, different beta releases are compatible with each other, but not compatible with those of the **release** type.<br/>- **Release**: Releases of this type are compatible with the latest five API versions. | 52| deviceType<sup>4+</sup> | string | Device type | 53 54The following error code will be returned if the device information fails to be obtained. 55 56| Error Code | Description | 57| -------- | -------- | 58| 200 | The returned result contains information that cannot be obtained. | 59 60**Example** 61 62``` 63export default { 64 getInfo() { 65 device.getInfo({ 66 success: function(data) { 67 console.log('Device information obtained successfully. Device brand:' + data.brand); 68 }, 69 fail: function(data, code) { 70 console.log('Failed to obtain device information. Error code:'+ code + '; Error information: ' + data); 71 }, 72 }); 73 }, 74} 75```