This cordova plugin is usefull to get device screen information.
cordova plugin add https://github.com/nayan-dabhi/cordova_plugin_screeninformation
ScreenInformation.getInformation(function(data){
console.log(data);
}, function(){
console.log("Unable to get device screen information....");
});
The plugin return a screen information JSON object.
Return values:
density_point
- Number (screen density dpi point)density_name
- String (screen density dpi name)width
- Number (screen width in pixels)height
- Number (screen width in pixels)xdpi
- Number (pixels per inch of the screen in the X axis)ydpi
- Number (pixels per inch of the screen in the Y axis)