Samsung Galaxy Tab 1 layout problems - layout

I'm having trouble running my app on the Galaxy tab original 7". It appears to make everything 1.5 times bigger, i.e. if I specify 40dip for a textSize in my layout, it will display as 60 dip when I run it on the tablet.
I tried messing around with the display metrics and changing the density and densityDpi to 1. (When I run a toString of the display metrics in the Galaxy tab 2, they are both 1, whereas the Galaxy tab 1 has values of 1.5)
The app runs very well on every phone I've tested it on, and on the Galaxy tab 2, so I can't figure out what the problem is. I even tried creating a dummy app with just a textView with a size of 40dip, and it still converted it to 60.
Any ideas?

Does the answer to this question help you? Seems that he is having the same (or similar) problem.
Android layout on emulator vs device
Android, concerning the User Interface design

Related

how can I get the exactly right size screen emulator in Android Studio?

I'm working with flutter in Android Studio in windows.
I set the screen size 768*1024(ipad mini size) when I create my virtual devices in android studio, but I find the height is smaller than expected. Actually when I call function window.physicalSize it shows that the size is 768*796.
I have gotten the fact that the function only shows the size of the screen that flutter can render.(So the hidden part is about what? bottom navigation bar,including three buttons, back, home, and the other one, or something else, I'm not sure.)
So, the question is how can I get exact size screen I want(768*1024)?

Android emulator display screen corruption

The emulator is working fine, and I can interact with it normally, but the bars at the top and bottom are extremely smeared and it's got these weird diagonal lines in the middle.
This is a screenshot of a Nexus 4, API 28. The screen corruption does not always appear - for instance, Nexus 5 API 27 works perfectly.
What causes this, and how can I fix it?

UI not aligned on samsung gt i8262

I have encountered a problem while adjusting UI for various devices on android.
I created res/values-hdpi folder and similar other folders to put the dimensions of the layout there and adjust app's UI. I tested it on two devices
1) HTC ONE S
2) Samsung GT i8262
Both the devices comes under normal hdpi category according to android developers site. But the layout is completely misaligned in samsung device. Is there a solution to this sort of problem. I have also checked by changing the dimensions in the values-hdpi folder to confirm that both devices pick from same resource and it does!!! Both pick the dimensions from values-hdpi folder but misaligned in one of them.
Note: Both devices have only hardware buttons no navigation bar. So need not worry about that.
My guess is that HTC ONE S is 256 ppi, samsung gt i8262 is 207 ppi, but both have 4.3" screens, is this the problem?? How do I solve this if this is the case?
I finally created two values folders values-sw360dp-hdpi for HTC 1S and values-sw320dp-hdpi for Samsung GT i8262 and it worked.

How to force the .xib / view to be letterboxed on iphone 5

As of May 1st, 2013 Apple is now requiring iPhone 5 support. I was hoping to appease them, by simply setting the 1136 pixel tall launch image, and then having all my views be letterboxed.
Anyone have a quick way to make all my .xib and views continue to be letterboxed on the iPhone 5, even though.
Just remove the Default.png file that has the size of the Iphone 5 width height and place the Iphone 4 size Default.png images. This will force the app to be shown letter boxed.
Also, The viceversa if you dont want to show letter boxed. i.e. stretched view for Iphone5
The best way is to use auto sizing for all the views, instead of using Auto Layout.

Virtual buttons not appearing on emulated Android 4.2 system

I have created an Android 4.2 AVD. For the need of my current project, the main screen orientation is landscape. The software keys option is selected.
The mode is set to xhdpi, like a Galaxy Nexus phone.
As I start the emulator, I see a black stripe on the right where the buttons should appear, but it remains black. Thus, there is no way to trigger a Back action since the emulated physical keys are disabled.
The problem can be fixed by configuring the emulator in portrait mode then rotate it once started; the buttons appear as expected. This causes problems since the window is automatically scaled down to fit on my monitor; I did not find any shortcut to restore 1:1 scaling at runtime, after the rotation is done. This is important since I would like to see pixel-perfect results.
I am using SDK version 21 and platform-tools version 16.0.2, as updated yesterday.
Found the solution myself... this is a workaround that allows getting 1:1 scale and the software buttons working.
Leave the AVD (Galaxy Nexus or cloned from it) on portrait mode.
Run the emulator from the command line, using the -scale 1 option; this is the magic that forces 1:1 pixel perfect ratio even if the window does not fit in screen at startup. By default, automatic downsizing happens to fit the monitor.
Rotate the display using Ctrl+F11 or Ctrl+F12 to get landscape mode.

Resources