Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

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

$
0
0

Hi,

 

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:

 

    navigator.userAgent.match(/(iPhone)/g)

    window.devicePixelRatio ==2

    scree.width()

    iQuery.device.is.phone

    $('#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)

   "laptop/desktop"

 

Thanks.

 

Dong Zhu

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


Viewing all articles
Browse latest Browse all 6178

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>