1

I use the below code to get the width of a Galaxy S6 screen in pixels

DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
Log.i("INFO", "width pixels "+metrics.widthPixels);

On one app this returns 1440 which is correct as per Samsung. On another app the same code returns 1080 ??

density also changes from 4 to 3 as well as xdpi 580 to 435

Any ideas why I'm getting two different results? Both apps target the same SDK: 23 and min SDK: 10

user3528766
  • 109
  • 1
  • 12

1 Answers1

1

The different resolutions are caused by the gameserviceon Samsung devices. You can check this by installing the Samsung Game Tuner on the device and setting your application to full mode. AFAIK there's no programatic way to set the app to full mode.

alfmatos
  • 56
  • 2
  • See [How to tell whether Samsung Game Tuner is changing resolution ratio](https://stackoverflow.com/q/38617750/199364) for a bit more information on what the second app must be seeing. However, this does not explain why the second app saw the adjusted (75%) resolution, while first app saw the raw (100%) resolution. – ToolmakerSteve Mar 08 '19 at 09:44