Galaxy Note 5: Density Reduced Automatically

╄→尐↘猪︶ㄣ 提交于 2019-12-13 14:19:01

问题


I created an app that relies on some screen metrics to function. It works great on all devices, except for the Galaxy Note 5. On the note 5 it reports the screen size of 1080x1920 while the screen is actually 1440x2560. I also see the following message in logcat:

"ActivityThread﹕ Switching default density from 560 to 420"

I'm finding the screen size by calling getWindowVisibleDisplayFrame in the following code:

Rect usable_rect = new Rect();
Window window = activity.getWindow();
window.getDecorView().getWindowVisibleDisplayFrame(usable_rect);

One other odd observation, if I use a package name other then my released app's package name the correct metrics are returned. Please help!


回答1:


We finally found the answer to the Note 5 reducing the usable space for our app/game. It turned out Samsung is doing some optimization on the usable screen size for battery performance. The only way we found to use the true screen size of the display is by downloading Samsung's Game Tuner app and setting the mode to "Maximum Quality". It appears that without the Game Tuner app installed the default "Balanced Quality" is used, which results in the 1080p usable area.

https://play.google.com/store/apps/details?id=com.samsung.android.gametuner.thin&hl=en




回答2:


Try this

Point size = new Point();
WindowManager w = getWindowManager();

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
    w.getDefaultDisplay().getSize(size);

    mWindowWidth = size.x;
    mWindowHeight = size.y;
} else {
    Display d = w.getDefaultDisplay();
    mWindowWidth = d.getWidth();
    mWindowHeight = d.getHeight();
}


来源:https://stackoverflow.com/questions/32620373/galaxy-note-5-density-reduced-automatically

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