How to remove vertical letterboxing from android TV app? - android

I have submitted an android tv app to the play store and got rejection email explaining the reason that:
Not designed in landscape orientation. Your app has vertical letterboxing when displayed on TV's. Please design your app to be displayed in landscape orientation.
I have tried removing margins from the screen designs but it didn't helped me. Can anyone help me in solving this issue. I have already added the leanback launcher intent and software.leanback uses feature tag with true value.
Thanks In Advance.

You don't want to just remove padding/margins without explicitly testing it. You have to deal with overscan on TVs, so having anything important at the very edge means it might not be visible on some devices. On ATV, the normal values are 48dp horizontally and 27dp vertically. If you're using the Leanback library, this is handled for you.
Vertical letterboxing is almost always a case of something that's inherently portrait orientation being show in landscape.
You should verify that none of your activities have a screenOrientation set (unless it's landscape). It's pretty common for people to forget one particular screen is forced to portrait (e.g., a login screen from a 3rd party SDK). A quick launch of each Activity/Fragment on an ATV emulator will also help you catch anything wildly wrong.
If your app has video, you also want to make sure you're reasonably matching the aspect ratio. For example, you should display a 16x9 video instead of a 2x3 video on landscape.

I have almost same problem:
To fix this issue, please ensure that your app/game is displayed in landscape orientation and the content fills the entire screen.
Alternatively, if your app requires content to be displayed in its original aspect ratio or is of older quality, please include a disclaimer in your app description or within the app prior to the content playing. You may want to refer to our TV Layouts documentation for additional guidance.
I choosed Alternate solution because the sent me a screenshot of old video in 4:3 scale.
I symply added to app description text about possibility to show content in 4:3 aspect ratio. I hope ot will help. Will it?

Related

I want my app to look the same on every phone in Android Studio

I designed an app with dp unit. I also used RelativeLayout. I designed app while Pixel 3XL screen selected like this. After i finished the design i changed the screen to the Pixel like this. Now my design looks bigger.Look the red line. Not equal to the Pixel 3XL. I want my app to look the same on every phone. Thank you.
From Document:
Android devices come in all shapes and sizes, so your app's layout
needs to be flexible. That is, instead of defining your layout with
rigid dimensions that assume a certain screen size and aspect ratio,
your layout should gracefully respond to different screen sizes and
orientations. By supporting as many screens as possible, your app can
be made available to the greatest number of users with different
devices, using a single APK. Additionally, making your app flexible
for different screen sizes ensures that your app can handle window
configuration changes on the device, such as when the user enables
multi-window mode.
This page shows you how to support different screen sizes with the
following techniques:
Use view dimensions that allow the layout to resize Create alternative
UI layouts according to the screen configuration Provide bitmaps that
can stretch with the views
https://developer.android.com/training/multiscreen/screensizes
https://material.io/design/layout/responsive-layout-grid.html
Try using constraintLayout if you want to build responsive designs.I have tested it on multiple devices and google also recommends it.Go through the link.
https://developer.android.com/training/constraint-layout

How to handle different screen resolutions for mobile phones in Unreal Engine? Specifically UI

I have looked around but, I am unable to find an answer to my question. Basically, I am creating a phone app. The only problem I seem to be having is with the menu UI. Basically, it is set to a 1080x1920 resolution, which is probably the most common one out there. However, it is not the only one. How do I handle multiple screen resolutions? Do I need to make like separate widgets for each resolutions and load in the correct one based on that? Or is there some other way that I am just not aware of. I am sure that others have come across this same problem too.
The reason I bring this up is because I have loaded the app onto a phone that is not 1080x1920 and the UI doesn't fit inside of it. I have tried messing with different settings on the UI but, nothing seems to fix it. Any help would be greatly appreciated.
There were two problems that were happening. The first reason why the UI wasn't scaling properly was because I was using a Size Box instead of just a plain Canvas Panel. It didn't matter what I did, the Size box would remain the same. Changing that would solve the first problem. The second problem that was happening was that because of the size box it forced my anchors to be centered instead of stretched. Once I replaced the Size Boxes with Canvas Panels I was able to make my panel anchors stretch to fill the screen.
I hope this helps anyone else that comes across this problem.

Android WebView always reporting landscape orientation

We were having trouble getting media queries to properly target Android tablets when in portrait orientation for an app I am currently developing. I did some testing using http://pieroxy.net/blog/pages/css-media-queries/test-features.html and discovered that Chrome works as expected when that page is loaded into it, but my app's WebView always registers as being in landscape orientation. I tried locking the activity to portrait only, to no effect. I've combed through my WebView code and AndroidManifest.xml looking for something I may have done to cause this behavior, but have come up empty. I would post relevant code, but I've been unable to find it. Google hasn't helped me so far, does anyone know what may likely be causing this issue? Any guidance on where to continue my bug search would be greatly appreciated.
After much hair pulling, I determined this was happening because it was reporting a height of 0px to the media query. Therefore width > height and it determined it must be a landscape orientation. I assumed it was a timing issue and moved a lot of code to onViewStateRestored but this changed nothing. The solution wound up being, of all things, to change the layout_height of my WebView from wrap_content to 0dp in the XML layout. This minor tweak apparently allowed it to determine a correct height at the right point and all media queries now target as expected.

Android Images not appearing until device is rotated

I'm designing for Mobile Web and have an image/button in a mobile site, (positioned by percentages) that shows up correctly on an iPhone (in portrait and landscape).
However, when tried on most Android phones, the image does not show up until the phone is rotated to a landscape position, and then will show up in the correct position in portrait. It will not load in portrait mode with the button showing.
I've tried positioning, z-index and that doesn't seem to be what is causing it.
Any help is greatly appreciated, thanks!
I'm not sure if I'm able to comment yet so I will just post this here and a mod can move it if they want.
Many browsers interpret css differently. I would make sure that you do not have overflow:hidden or overflow:inerit which is taking the form of "hidden." It's the only thing I can think that would lead to it being invisible until the screen is widened.

android screen resolutions and sizes

I am currently working on an android app that is causing me some trouble. My app is heavily dependent on images that are fitted correctly to the screen they are being displayed on. Unfortunately things like the FWVGA/WVGA resolution difference 854 vs 800 is causing me some real problems, and that's aside from the other sizes/densieites and resolutions.
I don't know if I'm just missing the point here but how do I go about having my app display correctly on both the resolutions without either "squashing" my images or cutting bits off of giving me black bars etc?
There doesn't seem an immediately present solution where I can just have it display a different image automatically from the drawable folder for the right screen.
I have tried using displaymetrics but unless i have my manifest claim that it supports all screen sizes, the android OS will in fact "lie" to my app about hte current resolution.
Someone please tell me there is an easy solution.
how do I go about having my app display correctly on both the resolutions without either "squashing" my images or cutting bits off of giving me black bars etc?
IMHO, you start by revisiting your GUI design:
My app is heavily dependent on images that are fitted correctly to the screen they are being displayed on.
That does not work particularly well anywhere, IMHO. Windows (including browsers) can be sized to any desired size by the user, for example.
There doesn't seem an immediately present solution where I can just have it display a different image automatically from the drawable folder for the right screen.
Because Android devices can have any number of screen dimensions, just like windows and Web browsers can have any number of screen dimensions. Android does let you choose images based on density (e.g., -hdpi) or screen size (e.g., -large), but these do not map to resolutions, nor should they.
As CommonsWare pointed out, your best bet for this situation really is to rethink your layout structure. It's probably possible to accomplish similar, if not identical results to what you currently have, using RelativeLayouts and widgets. If you're willing to post a sample, we could advise you on ways to do so.
That said, an answer to your question would be to query the device at runtime for its screen resolution (keeping in mind space taken up by the notification bar, as well as the title bar - unless you theme it without a title bar). You would need a different image for every possible screen resolution, and as more devices (notably tablets) begin to release, you're going to have to continue to provide more images and customized code for each different image as they release. You can see why this is not an ideal situation.
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int screenWidth = metrics.widthPixels();
int screenHeight = metrics.heightPixels();
Then you can place that into an if-then-else block, and determine the resolution, and set the image accordingly. I don't recommend this.
When it comes to displays and resolutions, it is not possible to have your images resized to any aspect ratio without either squishing / stretching them, or using letterboxes. I know this doesn't really answer you question, but if you can't get reliable screen size information from the OS, then try picking images for the largest resolution and cropping them for the smaller resolutions. Just make sure there is nothing interesting around the borders.

Categories

Resources