<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Getting the screen size of an android virtual device]]></title><description><![CDATA[<p dir="auto">All,</p>
<p dir="auto">'am running the following code snippet in Qt to get the screen size of my android virtual device.</p>
<pre><code>QApplication app(argc, argv);
 
 QDesktopWidget *mydesk = app.desktop();
    // redundant but using both showFullScreen and showMaximized...
    // ...just to play it safe
    mydesk-&gt;showMaximized();
    mydesk-&gt;showFullScreen(); 

  QScreen *screen = app.primaryScreen();
    int width = screen-&gt;size().width();
    int height = screen-&gt;size().height();
</code></pre>
<p dir="auto">I created a Nexus 5 Android Virtual Device with resolution 1080x1920 to test my code and my width and height values are 1080x1776 instead of the expected 1080x1920. What 'am I doing wrong here? Can someone please help me?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/topic/77096/getting-the-screen-size-of-an-android-virtual-device</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 19:30:29 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/77096.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Mar 2017 15:58:16 GMT</pubDate><ttl>60</ttl></channel></rss>