What is the best way to find out the underlying platform within AIR?

I'd like to know whether Air is running on iOS, Windows, Android or Blackberry.

Here's our Utuls_System class. It's a work in progress, incomplete, and does other stuff as well, but take a look at init() and isIOS() etc...
package com.brightworks.util
    import com.langcollab.languagementor.constant.Constant_AppConfiguration;
    import flash.system.Capabilities;
    public class Utils_System
        public static const OS_CATEGORY__ANDROID:String = "osCategory_Android";
        public static const OS_CATEGORY__IOS:String = "osCategory_iOS";
        public static const OS_CATEGORY__MAC:String = "osCategory_Mac";
        public static const OS_CATEGORY__UNKNOWN:String = "osCategory_Unknown";
        public static const OS_CATEGORY__WINDOWS_DESKTOP:String = "osCategory_WindowsDesktop";
        public static const OS_CATEGORY__WINDOWS_MOBILE:String = "osCategory_WindowsMobile";
        private static var _isInitialized:Boolean;
        private static var _isMobileDevice:Boolean;
        //          Getters / Setters
        private static var _appHeight:int;
        public static function get appHeight():int
            init();
            return _appHeight;
        private static var _appWidth:int;
        public static function get appWidth():int
            init();
            return _appWidth;
        private static var _dpi:int;
        public static function get dpi():int
            init();
            return _dpi;
        private static var _osCategory:String;
        public static function get osCategory():String
            return _osCategory;
        //          Public Methods
        public static function getAppStoreName():String
            if (isIOS())
                return "Play Store";
            return "App Store";
        public static function isIOS():Boolean
            return (osCategory == OS_CATEGORY__IOS);
        public static function isScreenResolutionHighEnough(requiredX:uint, requiredY:uint, isMobile:Boolean):Boolean
            init();
            if ((isMobile) && (!Utils_System._isMobileDevice))
                // We're testing on the desktop, and can't check screen size
                return true;
            if (Capabilities.screenResolutionX < requiredX)
                return false;
            if (Capabilities.screenResolutionY < requiredY)
                return false;
            return true;
        public static function isRunningOnDesktop():Boolean
            init();
            return !_isMobileDevice;
        //          Private Methods
        private static function init():void
            if (_isInitialized)
                return;
            _isInitialized = true;
            _isMobileDevice = true;
            var operatingSystem:String = Capabilities.os;
            if (operatingSystem.indexOf("Windows") != -1)
                switch (operatingSystem)
                    case "Windows XP":
                    case "Windows 2000":
                    case "Windows NT":
                    case "Windows 7":
                        _isMobileDevice = false;
                        _osCategory = OS_CATEGORY__WINDOWS_DESKTOP;
                        break;
                    default:
                        _osCategory = OS_CATEGORY__UNKNOWN;
                        Log.fatal(Constant_AppConfiguration.APP_NAME + " does not currently support this operating system. (" + operatingSystem + ")");
            else if (operatingSystem.indexOf("iPhone") != -1)
                _isMobileDevice = true;
                _osCategory = OS_CATEGORY__IOS;
            else if (operatingSystem.indexOf("MacOS") != -1)
                _isMobileDevice = false;
                _osCategory = OS_CATEGORY__MAC;
            else if (operatingSystem.indexOf("Linux") != -1)
                // This won't work properly if developing on Linux, but I've spent multiple minutes
                // trying to find out how to differentiate Android from other Linux versions, and
                // haven't found anything that I'm confident will work for future versions of Android.
                // Currently I get "Linux 2.6.32.9-g34b306d". I suspect that the "g" indicates "Google"
                // but have found nothing to support this idea.
                _isMobileDevice = true;
                _osCategory = OS_CATEGORY__ANDROID;
            if (_isMobileDevice)
                _appHeight = Capabilities.screenResolutionY;
                _appWidth = Capabilities.screenResolutionX;
            else
                _appHeight = 220;
                _appWidth = 360;
            _dpi = Capabilities.screenDPI;

Similar Messages

  • HT5996 What is the best way to find out what OS all Mac users on the server are running?

    I am the administrator of both Windows PC's as well as having 12 Mac-mini users.  I know several users have not updated their OS in quite a while.  Is there some way for me to find out what version a user is running beside going from one computer to another? 
    I do have OS X Server if that makes a difference.
    I have been working with Mac's for less than a year, so I'm a work in progress when it comes to the Mac World.
    Thanks!

    If you're able to log into those computers, check the content of the file /System/Library/CoreServices/SystemVersion.plist on them. If you're working from a Mac, you may also be able to find out by selecting the drive in the Finder and choosing Get Info from the File menu.
    (115722)

  • Best way to find out the applications/packages on the Sun Servers

    I need to find out what applications or packages are running on 10+ Sun Solaris servers, and the dependence.
    I am wondering what is the best practice to do this?

    Are you asking about what you see when you type "ps -ef" to see the processes? Or are you maybe also referring to what applications might be installed on your system for use? "pkginfo" lists all packages that are installed on the system, and you can go to the sysadm documentation on docs.sun.com to see a brief description of each of the packages.
    -- Alan

  • Is there a way to find out the given parameter is statis or Dynamic ?

    Hi All,
    Can some one tell me the best way to find out the given parameter is static or Dynamic?
    Thanks & Regards
    Rajesh Meda

    Well, Actually  I know there is a way for checking from RZ11 transaction.
    1.I need to prepare report with all the ABAP parameters  in the system that can be changed on fly
    2.I believe there is one ABAP report that will specify all the dynamic parameters. I need the report name
    Thanks & Regards
    Rajesh Meda

  • What is the best way to find a file on the servers disk without using web.xml?

              What is the best way to find a file on the servers disk without using web.xml?
              I want to find a configuration file not contained within the war file I have
              created. Is there a way to pass information into the ServletContext with out
              rebuilding the ear or war files? Tomcat 4.0 can do this in its server configuration
              files. Does BEA have the equivalent?
              Regards,
              Eric
              

    You can specify the path to the file as a system property
              eg
              java -Dconfig.file.location=./mydirecotry/myfile.txt com.test.MyApp
              "Eric White" <[email protected]> wrote in message
              news:[email protected]..
              >
              > What is the best way to find a file on the servers disk without using
              web.xml?
              > I want to find a configuration file not contained within the war file I
              have
              > created. Is there a way to pass information into the ServletContext with
              out
              > rebuilding the ear or war files? Tomcat 4.0 can do this in its server
              configuration
              > files. Does BEA have the equivalent?
              >
              > Regards,
              > Eric
              

  • I am giving away a computer, what is the best way to wipe out data prior to depature

    i am giving away a computer, what is the best way to wipe out data prior to depature

    Did the Mac come with two grey disks when new? If so, use disk one to erase the drive using Disk Utility and then re-install the OS from the same disk. Once installed, quit and when the new owner boots they can set it up as a new out-of-the-box Mac when they boot it up. The grey disks need to be passed on with the computer.
    If you need detailed instructions on how to erase and re-install please post back.
    If the Mac came with Lion or Mountain Lion installed the above process can be done using the Recovery HD as since Lion no restore disks are supplied with the Mac.
    The terms of the licence state that a Mac should be sold/passed on with the OS installed that was on the machine when new (or words to that effect).

  • There are way too many photos on my internal hard drive. I have older libraries, and newer libraires in iPhoto and Aperture 2.  What is the best way to find and reduce the number of duplicate photos/libraries  before upgrading to Aperture 3?

    There are way too many photos on my internal hard drive. I have older libraries, and newer libraires in iPhoto and Aperture 2.  What is the best way to find and reduce the number of duplicate photos/libraries  before upgrading to Aperture 3?

    Sharon-
    Good idea.
    Back up first.
    I would probably wait for the merge function of the latest version before merging. Be sure to verify every merge.
    Merge Libraries, then from within Aperture move images to referenced on external hard drives.
    HTH
    -Allen

  • What is the best way to find the size of files?

    What is the best way to find the size of my files?

    Select a file or folder in the Finder and choose Get Info from the File menu.
    (125056)

  • Looking for a way to find out the x,y coordinates of a string inside a PDF

    Hi!
    I'm looking for a way to find out the x,y coordinates of a string inside a PDF (with free java api's only)
    I got a pdf, and a string to find inside it, what i need to do is to get this string x,y position inside that pdf....
    If any one knows of such, plz let me know...
    Thanx ahead
    Daniel.

    vedmack wrote:
    Hi!
    I'm looking for a way to find out the x,y coordinates of a string inside a PDF (with free java api's only)
    I got a pdf, and a string to find inside it, what i need to do is to get this string x,y position inside that pdf....
    If any one knows of such, plz let me know...
    Thanx ahead
    Daniel.AFAIK, a string of text does not have an (x,y) location inside a PDF file. The location is exists on your screen, and will differ whenever you adjust the resolution of it. Text can have a location when it's stored as an image though, but than it's really the location of a certain number of pixels (not necessarily a string!).

  • Is there a way to find out the GUI version of a logged in user

    Hello all,
    SAP provides a method in CL_GUI_FRONT_END_SERVICES called GET_GUI_VERSION. This works fine for supplying the version information for the logged in user.
    Unfortunately, it doesn't have any input parameters to specify "ANY"  user name.
    I'm looking for a way to find out the gui version of all logged in users.
    Tables USR41 will give me a list of the logged in users
    I can then use USR21, ADR6 and ADRP to get more user info.
    But, I can't find a way to determine what GUI version each of the users is using.
    Does anyone have any ideas?
    Thanks
    Ed Baker

    We have done in a different way. ie we have used userexit SUSR0001 and coded using
    * Collect SAPGUI info of the user logging on
    call function 'RFC_SYSTEM_INFO' destination 'SAPGUI'
      importing
        rfcsi_export = i_rfcsi.
    Here i_rfcsi-rfcsaprl contains the version info of SAPGUI
    and updated this info in a custom table.

  • I'm buying a new Macbook Pro this week and am wondering what is the best way to copy over the software I have from my existing Macbook Pro to the new one? eg. Photoshop and Office etc. I no longer have the CDs.

    I'm buying a new Macbook Pro this week and am wondering what is the best way to copy over the software I have from my existing Macbook Pro to the new one? eg. Photoshop and Office etc. I no longer have the CDs.

    Ya know what I'm on a brand new MBP just about 24 hours old and you know whats been working amazingly for me. I have a 27inch iMac as well and i've just connected it to my network and been dragging files and apps across the network onto my new MBP. Its really working fast and its flawless. You could always do that option, Just go into sharing options and turn them on for both Macs. Then just click and drag. Of course they have to both be on the same network for this to be possible.
    Look at my network.
    Shared is what your looking at.  I click on there see all my computers files and then drag the ones i want form its folder to my MBP folders.  Hope that helps if your looking for a very simple way on a wireless network.

  • Is there any way to find out the serial number to an old ipod that i cannot find?

    theres a recall on the od ipod nanos the 1st generation ones and i purchased one and im not sure when and currently i am unaware of the whereabouts of the ipod. is there any way to find out the serial number without actually finding the ipod to confirm when i purchased it? thank you any help will be appreciated.

    iPod: How to find the serial number

  • Is there a way to find out the number of hits from iTunes for my podcast?

    Looking over my stats pages I see that 95% of all people listening to my podcast are coming from iTunes mac/windows. I suppose I could do the math, but i'm curious if there is a way to find out the exact number of people subscribed to the podcast in iTunes?
    Eric
    www.letsgetnaughtypodcast.com

    hi there you can use http://www.statcountercom
    this will give you a way to see exactly where everyone is from. just install the code it make and put it in your podcast page. and everytime some one come to the podcast you will find your info
    http://www.radioamerica1.com
    http://radioamerica.podomatic.com
    http://backalleyblues.podomatic.com
    here a few of my podcast that i have , hope this helped also

  • What is the best way to find and apply the samples in the sap library

    I am a fresh man in the process of learning sap .
    Mainly aim at the MM and SD model .
    They all say that the best way to accomplish the task is to follow the sap on-line help.
    because i don`t know the struts of the library , so to find what i need in the library becomes impossible for me as the library includes a lot of files .
    so please some one help me to direct the struts of the library and teach me the way how to find what i want ?
    thanks

    Hi,
    This forum is for BPX. Post Solution related quries in SAP Solution Forums.
    You can access MM and SD help at:
    http://help.sap.com/erp2005_ehp_02/helpdata/en/80/ea89395eb58c4f9d0c3e837cf0909d/frameset.htm under Logistics
    or http://help.sap.com/ -> SAP ERP -> Choose Release (for example SAP enhancement package 2 for SAP ERP 6.0) -> SAP ERP Central Compoennt (MM and SD under Logistics)
    From Materials Management Link you can navigate further to Purchasing, Inventory Management etc. From Sales and Distribution you can naviate further: Sales, Billing etc.
    For example to see help regarding Purchase Orders:
    You would first expand Logistics and choose Materials Management in Help Link for ERP Central Component. Here, choose Purchasing Node which will take you Purchasing Help screen -> Click and Purchase Orders Node and Expand the same for more information regarding Purchase Orders.
    You should be comfortable with SAP help link.
    Regards,
    Naveen.
    Search the forum with keywords before posting the query.

  • What is the best way to find what version of PDF Reader from Adobe is installed on a windows OS?

    Hi,
    I am developing a .Net App in which i want to find which version of PDF Reader from Adobe is installed on an Windows OS.
    It can be any of the software
    Adobe Reader
    Adobe Acrobat X Pro
    or any other.
    How to find out?

    The best way would be to find and query the AcroRd32.exe executable. The file version information is stored in the executable itself.
    There are lots of places in the registry that you could also potentially access relevant information.
    For example the uninstall string:
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
    Contains a string that you could use to search for the application version.
    How you would do this in .NET I'm not sure but you would use some kind of text search command to search for the relevant text and then use "if exists" condition.

Maybe you are looking for