2017-09-28 05:36:00 +08:00
|
|
|
import { Injectable } from '@angular/core';
|
2017-12-28 20:28:44 +08:00
|
|
|
import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
2017-09-28 05:36:00 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Extended Device Information
|
|
|
|
* @description
|
2018-08-17 04:43:50 +08:00
|
|
|
* Retrieves additional device information from the Device Hardware
|
|
|
|
* - memory
|
|
|
|
* - cpumhz
|
|
|
|
* - totalstorage
|
|
|
|
* - freestorage
|
2017-09-28 05:36:00 +08:00
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* ```typescript
|
|
|
|
* import { ExtendedDeviceInformation } from '@ionic-native/extended-device-information';
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* constructor(private extendedDeviceInformation: ExtendedDeviceInformation) { }
|
|
|
|
*
|
|
|
|
* ...
|
|
|
|
*
|
|
|
|
* console.log('The Memory is: ' + this.extendedDeviceInformation.memory);
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
@Plugin({
|
|
|
|
pluginName: 'ExtendedDeviceInformation',
|
|
|
|
plugin: 'cordova-plugin-extended-device-information',
|
|
|
|
pluginRef: 'extended-device-information',
|
2018-08-17 04:43:50 +08:00
|
|
|
repo:
|
|
|
|
'https://github.com/danielehrhardt/cordova-plugin-extended-device-information',
|
2017-09-28 05:36:00 +08:00
|
|
|
platforms: ['Android']
|
|
|
|
})
|
|
|
|
@Injectable()
|
|
|
|
export class ExtendedDeviceInformation extends IonicNativePlugin {
|
2017-09-28 05:44:06 +08:00
|
|
|
/**
|
|
|
|
* Get the device's memory size
|
|
|
|
*/
|
2017-12-28 20:28:44 +08:00
|
|
|
@CordovaProperty()
|
2017-09-28 05:36:00 +08:00
|
|
|
memory: number;
|
|
|
|
|
2017-09-28 05:44:06 +08:00
|
|
|
/**
|
|
|
|
* Get the device's CPU mhz
|
|
|
|
*/
|
2017-12-28 20:28:44 +08:00
|
|
|
@CordovaProperty()
|
2017-09-28 05:36:00 +08:00
|
|
|
cpumhz: string;
|
|
|
|
|
2017-09-28 05:44:06 +08:00
|
|
|
/**
|
|
|
|
* Get the total storage
|
|
|
|
*/
|
2017-12-28 20:28:44 +08:00
|
|
|
@CordovaProperty()
|
2017-09-28 05:36:00 +08:00
|
|
|
totalstorage: string;
|
|
|
|
|
2018-08-17 04:43:50 +08:00
|
|
|
/**
|
|
|
|
* Get the total storage
|
|
|
|
*/
|
2018-08-22 03:12:43 +08:00
|
|
|
@CordovaProperty()
|
2018-08-17 04:43:50 +08:00
|
|
|
freestorage: number;
|
2017-09-28 05:36:00 +08:00
|
|
|
}
|