Software Archive
Read-only legacy content
17061 Discussions

Moto-X Pure

New Contributor I

Hi ,

What be the closest emulator that comes with XDK that would match the below specs?

Display Size 5.7-inch, 2560 x 1440 pixel display (515 ppi) Moto-X Pure





0 Kudos
2 Replies

The closest would be to use the Debug tab, since you'll run and debug directly on the real device!

Unfortunately, I do not know what the CSS "rendering resolution" is on that device. It might be 1920x1080, or it might be less, it all depends on what the manufacturer decided was the best CSS resolution for rendering HTML. I have an updated sample, for the next release, that reports that info to you when you run the app; until that is available, here are some code snippets you can use to get to the numbers. You could just create a blank app, run it on the Debug tab while connected to your Moto X, and type in the appropriate bits on the debug console to get the results.

    var view = {
        screenWidth: null,          // screen width reported
        screenHeight: null,
        windowWidth: null,          // window width reported
        windowHeight: null,
        documentWidth: null,        // document width reported
        documentHeight: null
    } ;

// screen.width/height is supposed to report CSS pixels of entire display
// represents the "ideal viewport" if your app consumed the entire display
    function measureScreen() {
        view.screenWidth = screen.width ;
        view.screenHeight = screen.height ;

// reports the "visual viewport" in CSS pixels
// does not work in Android 2.x
    function measureWindow() {
        view.windowWidth = window.innerWidth ;
        view.windowHeight = window.innerHeight ;
        // return( "Viewing window: " + width + " x " + height + " vpx = " + width*window.devicePixelRatio.toFixed(1) + " x " + height*window.devicePixelRatio.toFixed(1) + " ppx" ) ;

// reports the "layout viewport" or "rendering viewport" in CSS pixels
// most interesting if you omit the viewport meta tag or use unusual viewport values
    function measureDocument() {
        view.documentWidth = document.documentElement.clientWidth ;
        view.documentHeight = document.documentElement.clientHeight ;


0 Kudos
New Contributor I

Thanks Paul,  I'll give this a shot

0 Kudos