---
title: "Determining the Operating System of User’s Device in Sencha Touch"  
description: "In this article, I’m explaining how to determine the operating system of user’s device in sencha touch."  
author: "Sumit Kesarwani"  
published: 2013-06-12  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/1324/determining-the-operating-system-of-user-s-device-in-sencha-touch  
category: "sencha touch"  
tags: ["sencha touch"]  
reading_time: 5 minutes  

---

# Determining the Operating System of User’s Device in Sencha Touch

In this article, I’m explaining how to determine the [operating system](https://answers.mindstick.com/qa/114592/which-mobile-operating-system-is-better-for-privacy-ios-or-android) of user’s device in [sencha touch](https://www.mindstick.com/blog/619/changing-sencha-touch-app-theme).\

Ext.os class provides useful information about the current operating system environment.

##### Example

##### Step-1:

Firstly create a store and named it OperatingSystemStore, add two fields name and value through field [configuration](https://www.mindstick.com/articles/13112/setting-up-the-perfect-configuration-for-your-work-computer) of the store and data through data configuration.

```
Ext.define('MyApp.store.OperatingSystemStore', {
    extend: 'Ext.data.Store',
 
    config: {
        data: [
            {
                name: 'iOS',
                value: Ext.os.is('iOS')
            },
            {
                name: 'iPad',
                value: Ext.os.is('iPad')
            },
            {
                name: 'iPhone',
                value: Ext.os.is('iPhone')
            },
            {
                name: 'iPod',
                value: Ext.os.is('iPod')
            },
            {
                name: 'Android',
                value: Ext.os.is('Android')
            },
            {
                name: 'WebOS',
                value: Ext.os.is('WebOS')
            },
            {
                name: 'BlackBerry',
                value: Ext.os.is('Bada')
            },
            {
                name: 'MacOS',
                value: Ext.os.is('MacOS')
            },
            {
                name: 'RIMTablet',
                value: Ext.os.is('RIMTablet')
            },
            {
                name: 'Windows',
                value: Ext.os.is('Windows')
            },
            {
                name: 'Linux',
                value: Ext.os.is('Linux')
            },
            {
                name: 'Other',
                value: Ext.os.is('Other')
            }
        ],
        storeId: 'OperatingSystemStore',
        fields: [
            {
                name: 'name'
            },
            {
                name: 'value'
            }
        ]
    }
});
```

Step-2:

Next drag-n-drop the list [component](https://www.mindstick.com/articles/12262/learn-how-to-make-a-component-in-magento-2) from the toolbox and add a [titlebar](https://www.mindstick.com/forum/1013/how-to-change-font-color-and-size-of-titlebar-in-sencha-touch) for [heading](https://yourviews.mindstick.com/view/81027/world-economy-heading-towards-recession) [purpose](https://www.mindstick.com/forum/161328/what-is-the-purpose-of-flush-true-in-the-print-function) , the titlebar will hold a button named Know Your OS, tapping on this button tell you your device’s operating system.

```
Ext.define('MyApp.view.OSList', {
    extend: 'Ext.dataview.List',
 
    config: {
        fullscreen: true,
        store: 'OperatingSystemStore',
        itemTpl: [
            '{name}: <code>{value}</code>'
        ],
        items: [
            {
                xtype: 'titlebar',
                docked: 'top',
                title: 'Operating System',
                items: [
                    {
                        xtype: 'button',
                        id: 'KnowYourOS',
                        itemId: 'mybutton',
                        text: 'Know Your OS'
                    }
                ]
            }
        ],
        listeners: [
            {
                fn: 'onKnowYourOSTap',
                event: 'tap',
                delegate: '#KnowYourOS'
            }
        ]
    },
 
    onKnowYourOSTap: function(button, e, eOpts) {
        Ext.Msg.alert('You are using ' + Ext.os.name);
    }
});
```

Output

![Determining the Operating System of User’s Device in Sencha Touch](https://www.mindstick.com/mindstickarticle/ddbd8bbb-cb26-4aaf-aa0f-f46ad62ffab4/images/4215cea8-2876-4c57-9819-60c4197d5440.png)

Tap on the Know Your OS button, you will get a message with the name of your device’s operating system.

![Determining the Operating System of User’s Device in Sencha Touch](https://www.mindstick.com/mindstickarticle/ddbd8bbb-cb26-4aaf-aa0f-f46ad62ffab4/images/d3c6c9e3-dfd6-4029-9f43-ae2803be385b.png)

---

Original Source: https://www.mindstick.com/articles/1324/determining-the-operating-system-of-user-s-device-in-sencha-touch

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
