Using the cordova-device-plugin, you can detect
device.platform
will be "Android" for android, and "windows" for windows. Works on device, and when simulating on browser. Here is a toast that will display the device values:
window.plugins.toast.showLongTop(
'Cordova: ' + device.cordova + '\n' +
'Model: ' + device.model + '\n' +
'Platform: ' + device.platform + '\n' +
'UUID: ' + '\n' +
device.uuid + '\n' +
'Version: ' + device.version + '\n' +
'Manufacturer ' + device.manufacturer + '\n' +
'isVirtual ' + device.isVirtual + '\n' +
'Serial ' + device.serial);