Skip to Content
avatar image
Former Member

SAPUI5: What is the best Reliable way to detect on which device my app is running?


I have developed a sapui5 app that can run on iPhone, iPad, and desktop. Depending on the running media, it will use different theme or UIs. The are several ways of detecting OS, device or screen resolutions, such as:


window.devicePixelRatio ==2


$('#phone').css('display') == 'none'

My question: what is the best and Reliable way in the code to find out which of the following devices my app is running on:

"iPhone" (valid for all kinds of resolutions)

"iPad" (all possible types)



Sr. Sys Developer●Enterprise Mobility●SAP●iOS●Web●Android

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 21, 2014 at 01:49 PM

    i think you should be using the Device apis, available under sap.ui.device

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Andreas Kunz

      Hi Sandip and Andreas,

      Thanks for your comments. The deatils below works fine so far. Br, /Dong