locked
how to build current device user agent

    Question

  • When my application is accessed from multiple devices like phones and tablets; i need to be able to build the browser passed user agents; how to build user agents for different devices. I need to send this agent to google analytics to track devices using my application. The following sample code is hard coding some information, is there a way to find for devices like ipad, andriod, etc?

    var sysInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); Windows.Devices.Input.TouchCapabilities tc = new Windows.Devices.Input.TouchCapabilities(); var hasTouch = tc.TouchPresent > 0; string.Format("Mozilla/5.0 (compatible; MSIE 11.0; Windows NT 6.3; Trident/7.0{0}; {1}; {2})",

    hasTouch ? "; Touch" : "", sysInfo.SystemManufacturer, sysInfo.SystemProductName);


    Thursday, August 14, 2014 8:08 PM

All replies

  • Hi sbprasadrao,

    A question: You are programming for Windows Store App, correct? Windows Store App can only run on Windows 8 Operation System or Tablet or Windows Phone, how could ipad or android list here? And I cannot understand what do you mean by "my application is accessed from multiple devices like phones and tablets", how they access to your application? By wifi or Bluetooth, USB or some other hardware connection?

    Do I misunderstand something, could you please clarify for me. Thanks.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, August 15, 2014 8:18 AM
    Moderator