Cheap Android 7' tablet (800x480): wrong aspect ratio, circles look like ellipsis - android

I need a lot of Android tablets for resale with my app. I bought some from internet (cheap chinese products) but all 7' 800x480 tablets shows circles as ellipsis (squares as rectangles), everything is stretched...
Some are Android 2.3.3, others are Android 4.0 but all of them show stretched UI.
Did someone have encountered the same problem?

After some flashing some new builds with changes in the sysconfig1.lhs, I've come to the conclusion that I don't believe there's a solution. The tests I did were on a Allwinner A10 tablet, specifically the M703 model running Android 4.0.4. Note that there are many devices with the same (or similar) hardware configuration but different names.
I dived into the sysconfig1.lhs that's included in the system image, which contains these lines:
lcd_x = 800
lcd_y = 480
And the corresponding touch screen values:
ctp_screen_max_x = 800
ctp_screen_max_y = 480
I measured the screen, which appears to be identical to Seraphim's measurement: 155×86mm. Working with that, I experimented with changing those values to either 864×480, or 800×444.
Unfortunately, neither option solved the issue.
864×480 simply clipped 64 pixels part of the display.
800×444 crashed SystemUI (as it no longer qualifies as sw480dp and therefore expected the device to be phone) and left a 36 pixel gap.
Perhaps the screen resolution needs to be set somewhere else, but I believe that it's the hardware that's somehow misconfigured.
There are many other lines in sysconfig1.lhs that are meaningless to me, such as:
lcd_dclk_freq = 33
lcd_if = 0
lcd_hbp = 46
lcd_ht = 1055
lcd_vbp = 23
lcd_vt = 1050
Perhaps there's some way of changing the pixel ratio, but I haven't experimented.

They are probably either:
not matching the screen physical size with the resolution aspect ratio. What is the physical size (width and height) of the screen?
having non-square physical pixels
If either of that is the case there is not much you can do unless you can do some serious hacking and change the resolution. You get what you pay for I'm afraid.

Related

Xamarin, Android: Lock Aspect Ratio to 16:9

We are working on an app that mainly uses either Framelayouts or Linearlayouts.
In our app, we provide 5 different folders with drawables, from mdpi to xxxhdpi.
Working with weights or DisplayDimensions made our app look the exact same on basically every smartphone device.
Every smartphone device, but one. The Samsung S8.
The problem is as seen below:
This is the main menu on almost any other device (S3, S4, S5, S6 -Edge, S7 - Edge)
This right here, is a screenshot of the mainmenu on the S8:
.
Removing the bottom buttons and displaying the app in fullscreen makes this even worse!
So what is going on here?
Simple - the S8 uses the same width (1440px) as the S7 for instance, but yet its screen is higher. Increasing the screen height without the width changes the aspect ratio.
While most smartphones use a ratio of 16:9, the S8 is somewhere at 20.5:9 I believe. Ergo: The screen DO NOT look the way they are supposed to.
Now theres gotta be a solution to that, which won't have us redisign almost every activity to ALSO fit the s8.
What optins are there?
Is there maybe an option in VISUAL STUDIO, to "lock" the aspect ratio to 16:9 and display maybe a black bar on top instead of streching the layout?
I hope you guys can help us! That'd be great!
Thank you!
Btw: I noticed that the apps that we made in unity which are usually games DO look the same. There the aspect ratio is maintained and a black bar is shown on the sides. This I hope, is possible for Visual Studio?
I have found a workaround, that is pretty easy.
if (Resources.DisplayMetrics.HeightPixels >= 2560)
{
intHeightOfDisplay = 2560;
}
else
{
intHeightOfDisplay = Resources.DisplayMetrics.HeightPixels;
}
Basically saying, that if the height of the display is heigher than "most phones" I just set it to the maximum height of my app. This works pretty much everywhere.

Android Studio and a 4:3 resolution

My most resend project involves a Samsung Tab A 9.7" with 1024x768 pixels in a 4:3 format. This tablet is quite new and this format is unfortionatelly not supported by Android Studio so I've tried adding a new virtual device with these resolutions. I've set the scale option to: '1dp on device = 1px on screen'
The thing that seems wrong, is there is a difference between dp and px. If, for example, the width of a view is set to 1024px, it lines up nicely with the borders of the screen. But if I set it to 1024dp, it is much smaller... 1dp=1px means it is supposed to be the same, right?
When I launch it on the tab, all content gets wrong sizes etc (due to the problem above ofc).
Is there a way to propper add a 4:3 resolition so it can be used in the layout editor? I know there is a difference between px and dp but 1/1 is supposed to be the same?
Thanks a lot,
Jesse
After a long mixture between research and trail and error, finally 'found' the cause. When adding a virtual device in android studio for a custom resolution, it automatically focuses on portrait mode I think. Putting a view till the middle in portrait mode inside the editor -> In the middle in landscape on the tablet. Not sure if this is mend to be or an error of some kind.
Found out you can use the Nexus 9 layout, also 4:3 (2048 x 1538).
Thanks for the support Nanoc

Targetting Android app on Phone and Kindle-Fire

i will be targeting my app to all the android devices, what is the best way of doing it? so far i will be targeting Android phone and Kindle-fire and here is my thoughts.
android phone and its working as expected with images,font size etc... so i thought to test my app for kindle-fire:
create AVD emulator for kindle-fire with the below specification but i have few problems testing on the kindle-fire:
the images are stretched out (not sure if the images size should be increased for kindle-fire?)
font size is smaller then android phone (which i have tested)
i have no back button in my activity so i assume the user will be able to use the back arrow button in kindle-fire but in the emulator there is none showing.
Here are the specs of the Kindle Fire
Width: 600px
Height: 1024px
Abstracted LCD Density: 169
Target: Android 2.3.3 - API Level 10
RAM: 512 MB
what do i need to do in order to look and feel on both android phone and amazon kindle-fire?
should i create two separate projects and target font-size and image-size?
i am not sure what else i need to consider.
For the font, be sure to use the sp unit of measurement.
For the images, you can store them in different folders and name the folder using different attributes.
http://developer.android.com/guide/topics/resources/providing-resources.html
I will say though, I had a difficult time differentiating between the kindle and my 10 inch tablets, because they are both judged to be large by android. So I just created different layout for them and checked for screen size in the onCreate. Here is the code.
Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
if(display.getWidth() <= 600 || display.getHeight() <= 600)
{
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
setContentView(R.layout.kindle_fire_layout);
}
else
{
setContentView(R.layout.anything_else);
}
To test on the emulator, use the code bellow to avoid android recognizing it as a xlarge device. Then you can put your resources where they should be.
Also keep in mind the the kindle fire ui takes some pixels off the view for the bar, etc, so you might want to also consider that
final Configuration config = new Configuration(context.getResources().getConfiguration());
config.screenLayout = (config.screenLayout & Configuration.SCREENLAYOUT_LONG_MASK) + Configuration.SCREENLAYOUT_SIZE_LARGE;
context.getResources().updateConfiguration(context.getResources().getConfiguration(), context.getResources().getDisplayMetrics());

Android screen size compatibility

I have a two questions.
First: I am looking at the Android compatibility definition document (CDD 4.0) and it states:
Devices MUST have screen sizes of at least 2.5 inches in physical diagonal size
Devices must report one of these densities: 120dpi, 160, 213, 240, 320
The aspect ratio must be between 1.3333 and 1.85
Must have minimum screen size of 460dp x 320dp (dp = density-independent pixel)
Suppose I have screen of 2"x3", with density of 120dpi, the screen would have:
Diagonal: 3.61" = good
Screen size: 320x480 dp = good
This is nicely compatible with Android CDD
If I change the width from 2" to 1.7", I get
Diagonal: 3.45" - still good
Screen size: 272x480dp - NOT COMPATIBLE
My first question is, why specify a diagonal value, when the WIDTH is really what affects compatibility? The width must be 2" minimum.
Second: If I don't need to be Android compatible and stick with the 1.7" screen size, will applications that were built for the smallest compatible display be able to run on my device? Will the UI of this application be cropped when run in my device?
Thanks much for any insight.
It's probably just an easy way to specify the requirement. If you have a portrait device, the width is smaller than the height. If you have a landscape device, the width is the large dimension. It's just easier to say "the diagonal" than "the smaller of the two screen dimensions when the device is laid flat" or something like that. There are lots of ways to say essentially the same thing.
If your device is smaller than the CDD requires, you will probably want to still report in Android that your device is of screen size small, so I imagine apps will run but layouts for many of them will likely not fit well as people will tend to test on CDD-conformant devices. It very much depends on what layouts people used, but I wouldn't be surprised if you saw some cropping.

Different Text Size under same screen resolution but different dpi in two Android machines

I have two Android machines - Samsung Galaxy Tab and HTC Flyer. They both have 1024x600 screen. However Tab has 240dpi screen while Flyer has 160dpi according to the log from Context.getResources().getDisplayMetrics() method.
My problem is that, I have a TextView defined, and according to those Android document, using unit of dp should give same physical size under different screen density(dpi). But what I observed is that, the text size appeared in Flyer is obviously smaller than that in Tab, no luck in using sp too. I want them to be in same size. Any clue in solving this problem in general?
Thanks in advance.
Well, the reported values are clearly a lie. I suppose the Galaxy Tab is the 7in model. This means that, based on the reported values, it has about 4.2in display height (1024 / 240 = 4.2in) and about 2.5in width. This means that the screen size would be 4.2x2.5 in - and in this case the diagonal would be about 4.9in. Is it correct - no it isn't, it has 7in display. Measure the sides of the screen and you would get the correct density. So, even when scaled by Android the result will be wrong because of the false density measurement.
Anyway, the answer of the question is:
No, no way to draw same-sized fonts, images and whatever. You need to get used to false metrics from the manufacturer. A false density reading reflects on all other scaling. Thus even mm/in would not help.
And one advise - don't try to match sizes between different products, unless absolutely necessary. If you succeed, then the text on the Galaxy Tab, for example, will look disproportional in regards to the other text on the device and will make your app look out-of-place. Stick to the Android textAppearanceSmall/Large, etc.
Please try the following units:
mm
Millimeters - based on the physical size of the screen.
in
Inches - based on the physical size of the screen.
http://developer.android.com/guide/topics/resources/more-resources.html

Categories

Resources