I'm displaying websites in a WebView on an Android TV. The device is 4k, but the Android is running in 1080p (and that is OK) BUT the WebView seems to render in a half-HD 540x960 (as reported by JavaScript window.screen.availHeight) - images and fonts look blurry.
This seems to match-up with density settings of a device metrics.density = 2. Is there a way to force full-resolution rendering in the app or the WebView itself?
Based from this documentation, The platform now allows apps to request that the display resolution be upgraded to 4K only for the compatible hardware.
To query the current physical resolution, you need to use the
Display.ModeAPIs. If the UI is drawn at a lower logical resolution and is upscale to a larger physical resolution, be aware that the physical resolution thegetPhysicalWidth()method returns may differ from the logical resolution reported bygetSize().
So what you need to do is to change the physical resolution by setting the preferredDisplayModeId property of your app’s window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With