Reputation: 3637
I was testing my app on a 3.6" screen with 480 x 850 pixels. It was working fine and all images show up.
I deployed it, and got a email from a friend saying that roughly 20% of the app gets cut down from the bottom. She is using 3.7" screen with 320 x 480 pixels.
Is there a fix for this? I thought that Android stretches everything for proportions.
I am only using hdpi folder in my app.
Upvotes: 0
Views: 438
Reputation: 15746
Android won't stretch the actual screen. It will stretch images under certain circumstances, but that doesn't sound like it's your problem.
First, I'd highly recommend you get the proper size images for at least mdpi, hdpi, and xhdpi. mdpi is drawn with the standard 72 resolution, and then comparatively hdpi is 1.5X mdpi, and xhdpi is 2.0X mdpi.
Second, if you program your screen components correctly you are using Density Independant Pixels (dip, or dp), and text is sized with sp. This means that no matter what size screen you are on, something shows as the same size. So there isn't scaling that's happening, but rather, Android is keeping the same scale (this is very good). This means that on some screens your app will show on the entire screen, and on other smaller screen devices, it can only show a portion of your screen. This sounds like what is going on. You need the ability to SCROLL your content, so in your main layout file, put the child as a ScrollView. This is the correct way to handle your issue.
Edit: You could fix this the way that the other 2 posters I see are saying, as in saying you support any-density so the screen scales, but this isn't the proper way of doing things. You want your content to be scrollable, lest you end up with very small-unreadable text on small screens, or giant unweildy text on big screens. You want your content to be the same size in physical space no matter what device it's displayed on, which is why Android uses dp's.
Edit2: You could design your screen allotting percents of the screen to different components. The way you do that in Android is using the LinearLayout. The linear layout has a weight sum attribute. If you set the weight sum to 100, you can then set the childrens weights to the percent you want it to take up the screen. So if you wanted to give the bottom view 20% of the screen, in a LinearLayout with orientation vertical, you'd set the first view's weight to 80 (taking up 80% of the screen), and the bottom to 20. Make sense?
Upvotes: 1
Reputation: 1645
You have to use mdpi,hdpi and ldpi folder for images.. Android app take it self as its resolution, so use three of them, If you want to support your app in all device thn you should also use layout/large,layout/medium,layout/xlarge,layout/small.
for more Information refere this link
for that you have to make some changes in your menifest file also e.g
<supports-screens android:resizeable=["true"| "false"]
android:smallScreens=["true" | "false"]
android:normalScreens=["true" | "false"]
android:largeScreens=["true" | "false"]
android:xlargeScreens=["true" | "false"]
android:anyDensity=["true" | "false"]
android:requiresSmallestWidthDp="integer"
android:compatibleWidthLimitDp="integer"
android:largestWidthLimitDp="integer"/>
for that refer this link
Upvotes: 2
Reputation: 3585
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
Add this to your manifest file of app.
Upvotes: 1