https://github.com/androidovshchik/cordova-device-info
Simple plugin that provides info about Android device
https://github.com/androidovshchik/cordova-device-info
Last synced: 8 months ago
JSON representation
Simple plugin that provides info about Android device
- Host: GitHub
- URL: https://github.com/androidovshchik/cordova-device-info
- Owner: androidovshchik
- Created: 2020-12-08T08:18:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-11T08:48:54.000Z (over 5 years ago)
- Last Synced: 2025-01-18T18:53:32.710Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 158 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## cordova-device-info plugin
Simple plugin that provides info about Android device
### Getting started
Create a new Cordova Project
$ cordova create example com.example Example
Install the plugin
$ cd example
$ cordova plugin add https://github.com/androidovshchik/cordova-device-info.git
Edit `www/js/index.js` and add the following code inside `onDeviceReady`
```js
// it wrappers this library https://github.com/nisrulz/easydeviceinfo/wiki/Usage
DeviceInfo.makeReflection(['EasyMemoryMod.getTotalRAM'], function(result) {
DeviceInfo.makeReflection(['EasyMemoryMod.convertToMb', result], function(result) {
console.log(`Total RAM in mb: ${result}`);
});
});
DeviceInfo.retrieveIMEI(function(result) {
console.log(`IMEI: ${result}`);
}, function(error) {
console.log(`IMEI error: ${error}`);
// todo request permission READ_PHONE_STATE
});
DeviceInfo.getLanguages(function(result) {
console.log(`Languages: ${result}`);
});
DeviceInfo.getZoneOffset(function(result) {
console.log(`Timezone offset in millis: ${result}`);
});
DeviceInfo.observeScreenshots(function(result) {
if (result != null && result.toLowerCase().includes('screenshot')) {
console.log(`Screenshot path: ${result}`);
}
}, function(error) {
console.log(`Observe error: ${error}`);
// todo request permission READ_EXTERNAL_STORAGE
});
```
Install Android platform
cordova platform add android
Run the app
cordova run android
### Proguard
```
-keep github.nisrulz.easydeviceinfo.base.** { *; }
```