Galaxy S6 screen dimensions - android

空扰寡人 提交于 2019-12-11 12:41:31

问题


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


回答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.



来源:https://stackoverflow.com/questions/36757198/galaxy-s6-screen-dimensions-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!