Results 1 to 5 of 5

Thread: Ext.is.Phone - detecting device types

  1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    419
    Answers
    2

    Default Answered: Ext.is.Phone - detecting device types

    Hi,

    How can I detect whether the user is running a tablet or phone? I thought I could use Ext.is.Phone for example, but this doesn't seem to work in PR3.

    Thanks

  2. It's moved to Ext.os. Here are a couple examples:

    Ext.os.is.Desktop
    Ext.os.is.Phone
    Ext.os.is.Tablet

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    It's moved to Ext.os. Here are a couple examples:

    Ext.os.is.Desktop
    Ext.os.is.Phone
    Ext.os.is.Tablet
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    631
    Answers
    10

    Default

    I don't know if this has changed for 2.0 but in 1.1 we had to do this for Android and Playbook tablets.

    Code:
                // Need manual check for Android and Playbook tablets
                Ext.is.platforms.push({
                    property: 'userAgent',
                    regex: /(?=.*android)(?=.*mobile)/i,
                    identity: 'AndroidPhone'
                }, {
                    property: 'userAgent',
                    regex: /playbook/i,
                    identity: 'Playbook'
                });
    
    
                Ext.is.init();
                Ext.is.AndroidTablet = Ext.is.Android && (!Ext.is.AndroidPhone);
                Ext.is.Tablet = Ext.is.iPad || (Ext.is.Android && !Ext.is.AndroidPhone) || Ext.is.Playbook || Ext.is.Desktop;
                Ext.is.Phone = !Ext.is.Tablet;

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Quote Originally Posted by mitchellsimoens View Post
    It's moved to Ext.os. Here are a couple examples:

    Ext.os.is.Desktop
    Ext.os.is.Phone
    Ext.os.is.Tablet
    It has changed.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #5

    Default Identify device using UUID or IMEI Number

    I have use this code below code, i would like to identify the device by uuid but its not showing the uuid.

    requires: ['Ext.device.Device'],
    launch: function() {
    alert([
    'Device name: ' + Ext.device.Device.name,
    'Device platform: ' + Ext.device.Device.platform,
    'Device UUID: ' + Ext.device.Device.uuid
    ].join('\n'));
    }

    May you please help me on how can i retrive the uuid or even IMEI Number

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •