Search code examples
androidtelevisionleanback

Find Overscan margin on Android Tv programmatically


As mentioned in documentations at here:

Screen elements that must be visible to the user at all times should be positioned within the overscan safe area. Adding a 5% margin of 48dp on the left and right edges and 27dp on the top and bottom edges to a layout ensures that screen elements in that layout will be within the overscan safe area.

Thought, this doesn't seem proper solution for variety of devices as overscan margin differs for different vendors significantly.

In stead of setting fix margin, is there any way we can get/calculate the overscan area for Android TV devices?


Solution

  • No.

    Android TV comes in two basic forms: built into the TV and as a separate set-top box. In the latter case in particular, the box has no way to know what the overscan is, because it does not know much about the details of the TV, monitor, projector, etc. that it is plugged into. I do not know if overscan information is available as part of HDMI communications, but there is no requirement that the Android TV box be limited to HDMI.

    Most likely, if it were possible to handle this programmatically, they would have done so in the operating system.