title: Detecting 4K UHD screens on Android
body: <p>I am trying to detect when a device is capable of outputting at 4K UHD (3840x2160) resolution. A number of devices such as the nVidia Shield TV and the Sony Xperia Z5 Premium will report that they are running at 1080p even though they are capable of UHD, because they default to 1080p output for non-video layouts. I need some way to detect if they are 4K capable to distinguish between them and non-4K devices like the Nexus Player.</p>
  
  <p>Here is the code I'm using to determine the current resolution:</p>
  
  <pre><code>WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
  Display display = wm.getDefaultDisplay();
  Point size = new Point();
  display.getSize(size);
  </code></pre>
  
  <p>On the Shield TV, this returns 1920x1080 all the time, even when ExoPlayer reports that it's outputting video at 3840x2160.</p>