This is the function I use to detect the type of device:
public static function getBrowserType(): String {
var browserType: String = "Undefined";
var browserAgent : String = Browser.navigator.userAgent;
if (browserAgent != null) {
if ( browserAgent.indexOf("Mobile") >= 0
|| browserAgent.indexOf("Android") >= 0
|| browserAgent.indexOf("BlackBerry") >= 0
|| browserAgent.indexOf("iPhone") >= 0
|| browserAgent.indexOf("iPad") >= 0
|| browserAgent.indexOf("iPod") >= 0
|| browserAgent.indexOf("Opera Mini") >= 0
|| browserAgent.indexOf("IEMobile") >= 0
) {
browserType = "MOBILE";
}
else {
browserType = "DESKTOP";
}
}
return browserType;
}
I hope it can help.