1 Reply Latest reply on Aug 10, 2011 11:33 AM by Adam Altman (Adobe)

    Change Settings on different device(s)

    s_davies Level 1

      Is it possible to detect whether or  not its an ipad or smartphone so that I can select a different stylesheet or do some amends?

      Si

        • 1. Re: Change Settings on different device(s)
          Adam Altman (Adobe) Adobe Employee

          Hi Si,

           

          As far as I know, you can't detect a specific device, but you can detect characteristics of the device like the OS or resolution. In CSS, for example, you can detect a high-resolution device and make your default font bigger with:

           

          @media (application-dpi: 320) AND (os-platform:"IOS"), (os-platform:"Android")

          {

               global

               {

                    fontSize: 36;

               }

          }

           

          More details are in Adobe's CSS docs.

           

          In your AS code, you have acces to more characteristics. Check out flash.system.Capabilities. For resolution in Flex 4.5, look into the applicationDPI and runtimeDPI properties of spark.components.Application.

           

          -Adam

          Flex SDK developer