locked
Detection of device type the metro app is running on

    Question

  • Hello,

    I don't know how (and if it is possible) to detect device type the metro application is running on. I need to detect if it is regular PC, Tablet, RT version or Windows8 Phone.

    I found few similar questions here, but this problem was not solved there.

    Thanks in advance.


    Monday, January 14, 2013 11:08 AM

Answers

  • If it's just for statistics, on your Developer Dashboard, on the App Reports, the Usage section has a filter by device (Laptop, Tablet, Desktop, Other) to measure where is the App used most.
    • Marked as answer by J a k u b Thursday, January 17, 2013 12:59 PM
    Thursday, January 17, 2013 12:55 PM

All replies

  • Hi,

    Which capability of the device are you trying to detect? Maybe there isn't a direct way of detecting the device but there is a direct way of detecting the capability (for example, screen resolution, resolution scale, DPI).

    Monday, January 14, 2013 12:54 PM
  • From JavaScript you can use the clientInformation object to detect the CPU type.

    Windows Store apps don't run on Windows Phone 8, so that one's easy ;)

    There is no difference to detect between a "Regular PC" and a "Tablet", so that is not generically solvable.

    You can try to decide what you actually mean by that and--like Ealsur suggests--once you know your definition you can try to detect that feature difference.

    Note that desktops may have touch monitors and portable systems may have add-on or convertible keyboards, and any of these "differences" may change on the fly. The differences are fuzzy and there are no standard definitions, so you will need to determine what exactly you mean.

    You should avoid making behavior changes in your app based on form factor. Instead let the user's actions drive the behavior. For example, I have a touch screen but I am currently using a physical keyboard and there is no need to show a touch keyboard; however, if I touch the screen then the soft keyboard will appear.

    --Rob

    Tuesday, January 15, 2013 4:37 AM
    Owner
  • @Rob i don't want to make behavior changes in the app. I need this infromation only for statistics - I want to have information: how many users uses my app from PC and how many from tablet. I am not searching for the exact capability of the device. I was hoping, that there is some easy way in WinJS to identify and categorize the user device.

    Here is article about how web page can detect device type, but in the Win store app it does not works this way. I want to get similar result as in that article in My app.

    Thursday, January 17, 2013 12:29 PM
  • If it's just for statistics, on your Developer Dashboard, on the App Reports, the Usage section has a filter by device (Laptop, Tablet, Desktop, Other) to measure where is the App used most.
    • Marked as answer by J a k u b Thursday, January 17, 2013 12:59 PM
    Thursday, January 17, 2013 12:55 PM
  • I'd like to figure out how many images my Windows Store App can open at a time depending on the particular computer in use.

    I can open a sufficient amount on Surface RT before things get murky. On my Windows 8 desktop, I can open more without trouble

    So, given the average size of each image, is there a way to figure out how many images can be opened on a particular computer?

    If there is no better alternative, can I detect whether RT or Windows Phone is being used, and assume that anything else probably has greater capabilities and allow more images to be loaded?

    Wednesday, February 06, 2013 7:07 PM