Sencha Touch - Environment Detection


Advertisements

It helps you in identifying which operating system you are using, which browser you are working on, and what are the features available for your environment.

Sencha Touch provides different functions to get information specific to the environment. All the methods mentioned below can be checked in, if the condition is if(Ext.os.is.Windows){} and is based on the condition tasks can be performed.

All the following methods return Boolean value.

Operating System

Ext.os is a class that gives you different methods to know which operating system we are working on.

Sr.No Method & Description
1

Ext.os.is.webOS

This function will return true if you are using webos operating system else it returns false.

2

Ext.os.is.RIMTable

This function will return true if you are using RIMTable operating system else it returns false.

3

Ext.os.is.Linux

This function will return true if you are using Linux operating system else it returns false.

4

Ext.os.is.Windows

This function will return true if you are using windows operating system else it returns false.

5

Ext.os.is.MacOs

This function will return true if you are using Mac operating system else it returns false.

6

Ext.os.is.BlackBerry

This function will return true if you are using BlackBerry operating system else it returns false.

7

Ext.os.is.iOS

This function will return true if you are using IOS operating system else it returns false.

8

Ext.os.is.Android

This function will return true if you are using Android operating system else it returns false.

Device Detection

Sr.No Method & Description
1

Ext.os.is.iPad

This function will return true if you are using iPad else it returns false.

2

Ext.os.is.iPhone

This function will return true if you are using iPhone else it returns false.

3

Ext.os.is.iPod

This function will return true if you are using iPod else it returns false.

Version of Operating System

Sr.No Method & Description
1

Ext.os.name

It returns the name of the operating system.

2

Ext.os.version.version

It gives the version of operating system we are using.

Browser Detection

Sr.No Method & Description
1

Ext.browser.is.IE

This function returns true if we are using Internet explorer browser else it returns false.

2

Ext.browser.is.FF

This function returns true if we are using FireFox browser else it returns false.

3

Ext.browser.is.Chrome

This function returns true if we are using Chrome browser else it returns false.

4

Ext.browser.is.Opera

This function returns true if we are using Opera browser else it returns false.
5

Ext.browser.is.Safari

This function returns true if we are using Safari browser else it returns false.

This function Ext.browser provides various other functions −

Sr.No Method & Description
1

Ext.browser.userAgent

It returns the current userAgent.

2

Ext.browser.isSecure

It returns true if the current page is using SSL.

3

Ext.browser.isStrict

It returns true if the browser is in strict mode.

4

Ext.browser.engineName

It returns the browser engine name (WebKit, Gecko, Presto, Trident and Other).

5

Ext.browser.engineVersion

It returns the version of the browser engine.

Features

Ext.feature.has is to check if the browser has following feature or not.

Sr.No Method & Description
1

Ext.feature.has.Audio

This method returns true if browser supports audio tag feature of html5.

2

Ext.feature.has.Canvas

This method returns true if browser supports canvas tag feature of html5.

3

Ext.feature.has.classList

This method returns true if browser supports classlist feature of html5 which is used to add, remove and toggle css classes for the html element.

4

Ext.feature.has.Css3dTransforms

This method returns true if browser supports Css 3d Transform feature of css3.

5

Ext.feature.has.CssAnimations

This method returns true if browser supports animations of css3.

6

Ext.feature.has.CssTransforms

This method returns true if browser supports Css transform feature of css3.

7

Ext.feature.has.CssTransitions

This method returns true if browser supports transition feature of css3.

8

Ext.feature.has.DeviceMotion

This method returns true if browser supports the device motion feature.

9

Ext.feature.has.Geolocation

This method returns true if browser supports the Geolocation feature of html5.

10

Ext.feature.has.History

This method returns true if browser Supports history feature of html.

11

Ext.feature.has.Orientation

This method returns true if browser can detect which the device orientation.

12

Ext.feature.has.OrientationChange

This method returns true if browser can detect change in Orientation of the device.

13

Ext.feature.has.Range

Range is a type of html input tag for range slider element so if browser supports slider this function returns true.

14

Ext.feature.has.SqlDatabase

Web sql database is a web page api for storing data n database on which we can perform query operations. This method returns true if browser supports web Sql Database.

15

Ext.feature.has.Svg

Svg stands for Scalable Vector Graphics this method returns true if browser supports html 5's svg feature.

16

Ext.feature.has.Touch

This method returns true if browser has Touch feature.

17

Ext.feature.has.Video

This method returns true if browser supports html 5 video tags.

18

Ext.feature.has.Vml

Vml stands for vector markup language which is an xml based markup language. So this method returns true if browser has supports vml.

19

Ext.feature.has.WebSockets

Web socket is basically a communication protocol for computers which supports two communication between clients and server. This method returns true if browser Supports WebSockets else it returns false.

Advertisements