Sometimes there is a need when you need to detect what environment your Flex mobile application is running.
Common scenario with my projects is to launch a Link to PDF to a external browser rather than using StegeWebView which is built in to Flex SDK.
There could be many other scenarios that I can think of but it depends on the Application writer why and when its required
Here is the code snippet that will help ya out
public function getOS():String { switch(true) { case (Capabilities.version.indexOf('IOS') > -1): { return "IOS"; } case (Capabilities.version.indexOf('QNX') > -1): { return "BB"; // blackberry } case (Capabilities.version.indexOf('AND') > -1): { return "ANDROID"; } default: return ""; break; } }
If you would like to add anything to the above code please leave a comment.
Cheers
.
Link to this article is below
Search Terms:
- flex mobile detect os
- flex mobile detect platform
- detect ios vs android flex mobile
- how to check whether mobile is an android os?
- flex detect ios
- flex mobile os
- flex mobile check os








Hi,
this info was very helpful, but the head of the switch statement is typed wrong.
It should test for true and not for Capabilities.version
Linke this:
switch(true){
…
Thnkx for that. Well even if I would have left it like that It would still work (so the switch header was not wrong) but for clarity sake I’ve changed the switch header. Well this happens, when you try to write code while you are writing an article and not copy pasting the same from where you’ve already used it
thank’s o/