Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if an application is running as a mobile or desktop air applicaton?

How can I find out what the current application type is? i.e. whether it's running on a mobile device or as a desktop Air application?

I've tried this:

if(FlexGlobals.topLevelApplicatoin as WindowedApplication)
 //desktop

However the mobile Version can't find the WindowedApplication class.

How do I tell the difference?

like image 618
Maurice Raguse Avatar asked Jan 27 '26 01:01

Maurice Raguse


1 Answers

ok this works:

public static function isAndroid():Boolean
{
    return (Capabilities.version.substr(0,3) == "AND");
}
public static function isIOS():Boolean
{
    return (Capabilities.version.substr(0,3) == "IOS");
}
 ... //is Blackberry

public static function isMobile():Boolean
{
    return (isAndroid() || isIOS()); // || isBlackberry()
}
like image 97
Maurice Raguse Avatar answered Jan 28 '26 19:01

Maurice Raguse



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!