Do devices with different screen densities really look that different? - android

I only have one actual device to test on, a Nexus One but I've briefly used a Droid X in the past. I recall a better looking screen but I don't remember it fitting more icons on the home screen than my N1. So I'm wondering if my emulators and such are truthful or not.
I'm running 2 emulators, WVG800, one at 240 the other 160. The 240 looks right. The 160 doesn't, everything is much smaller including buttons, radio buttons, things that I have not specified an exact size for. The Supporting Multiple Screens document shows different densities looking exactly the same in the image below. However, my emulators do not maintain that look. Is something wrong?

They have different display size in real world. WVGA800 with density 240 is likely to be a phone with 4" screen. And WVGA800 with density 160 is probably a tablet with 7" screen. Check the option Scale display to real size when you starting emulator to see the difference.

Related

Android: Layout not fitting on screen, allthough it should

I have written an android app and have tested it for all kind of screen sizes and densities (Using the android emulator). I have also tested the layout for relatively small screen sizes, for example the WQVGA device (3,3", ldpi, 240 x 400)) and it's working fine. I have two physical devices (sony z3 compact with 4,6" and sony xperia v (4,3"), which display the layout in the correct way. Lately a friend came over and i wanted to show him the app on his smartphone (sony galaxy s2 plus (4,3")) and the layout was totally destroyed, meaning that the display seemed to small. TextViews and buttons weren't displayed properly.
I don't really understand this. All those devices are in the category "medium". And the screen size of the S2 Plus is equal to the one of the Sony Xperia V (and even a lot bigger than the WQVGA). So why does this device display my layout properly. I want to use the old size-qualifiers (small, medium, large, xlarge), because i target api-level 11.
How can i solve this issue? I don't want to redesign my layout for medium-devices, since it really looks the way i want it to look on all the devices, which work properly.
Actually you are confused between resolution & screen size.Galaxy S2 Plus & Sony Xperia V have same screen size but their resolution are different 480*800 pixels & 720*1280 pixels respectively.So both device are under different resolution so your application supports xhdpi & ldpi but doesn't in
hdpi.You should provide support for hdpi.For more clarification you should provide code.
For more reference refer:
1.http://android-developers.blogspot.in/2009/10/support-for-additional-screen.html
2.http://developer.android.com/guide/topics/manifest/compatible-screens-element.html
3.http://developer.android.com/guide/practices/screens_support.html

How does changing dpi in build.props on Android phones work? isn't DPI hardware related?

Also when I change the DPI to a lower value, everything becomes smaller. Aren't they supposed to get bigger?
OK, I got the answer. I'm posting it here for someone else with the same doubt.
The purpose of the DPI setting is to make sure things aren't too large or too small depending on your screen size vs resolution. A larger device, like a tablet with the same screen resolution as your phone would have a lower DPI screen since it's bigger. If your phones screen was the size of a tablet all the stuff on it would look huge if you kept the same dpi. A lower DPI makes things smaller and allows this tablet to show more stuff on the screen at once.

What is the best screen resolution for an Android AVD?

This is might seem to be a sort of silly question to ask but I would like to know while testing our apps what is the best resolution to be used (HVGA/WVGA/QVGA?etc)?
I ask this because I want the layout and the performance of the device to be consistent across most screen sizes.
There is a regularly updated diagram with the screen sizes and densitys available at the android developers site:
Source
This doesn't tell you an exact resolution, but seperates all phones into 4 sizes (small, normal, large, xlarge) and densities. This should give you a hint at least.
The biggest chunk is obviously Normal/hdpi, I guess that should be a lot of 3.7" HDPI displays with a 480x800 resolution (or at least close to this res). Like the Nexus One or HTC Desire (there are sure some newer ones, but I only keep an eye on the market when I'm searching for a phone to buy).
You can use all resolution to test your application, because some phones have QVGA resolution, some HVGA or WVGA resolution. Tablets have others resolutions.
More informations : http://developer.android.com/guide/practices/screens_support.html
If you use the dp unit for the sizes of your screen elements, then you shouldn't need to worry (as much) as this is a relative size, based on the pixel density of the screen.

Android emulator screen sizes

From your experience as an android developer what emulator screen sizes do you use?
Are there a couple that tend to catch most UI sizing issues or do you test your app in every size and density?
While coding, try to cover at least one of each from this table: http://developer.android.com/guide/practices/screens_support.html#testing . After most of the work is done, I would suggest try every combination you'll find in real devices you plan to deploy your app.
My very basic list while I am designing the UI is:
WQVGA 120 dpi
HVGA 160 dpi
WVGA 160 dpi
WVGA 240 dpi
Add 480x640 240 dpi if you want to support small screens.
You can use the pie chart here to have an idea of relative screen size usage: http://developer.android.com/resources/dashboard/screens.html
BTW, I have use AVDs from Donut to Gingerbread also.
At some point, I test on every size and density that I intend the app to run on. It's irresponsible not to do so.
But beware of densities; because of dpi scaling, you may be running what you think is an hdpi emulator, but the emulator is loading mdpi resources (or vice versa). It's a good practice when testing to log the reported density during onCreate of your launch activity. (My approach, though, is to use an app icon for each density that displays the density, at least until I want to test the real app icons. That way I can tell from the home screen what the emulator thinks it is running.)
you should test your app in every size , in order to be sure that your app will work fine in every android phone ;
and for density , try to create your UI with dip :)
hope it helps

Which screen resolution when designing an app?

When I design Android apps, I use HVGA resolution in the emulator. I saw (on YouTube and other videocasts) that some developer use higher resolution like WVGA or similar.
Which resolution is best for designing nowadays Android apps? Why?
Why restrict yourself to one resolution? You are perfectly able to customize the design for all screen resolutions. See this page in the developer docs: Supporting Multiple Screens
It tells you how to support multiple screen sizes and how to test them.
The best resolution to design for is the resolution that the user is using. That sounds obvious, but as there are a plethora of Android devices, there are also a plethora of supported screen resolutions. What you need to do is make sure you design your app to support a multitude of resolutions so that it looks great on all devices, not just one. #Tchami points out how to get started.
All of them, simultaneously, because there's nothing more annoying than getting 95% of the way through an app and discovering your boss is testing it on an HTC Desire, her boss is testing it on a Galaxy Tab, and they both want it to look right for them.
For your design time, Tackle multiple resolutions first, landscape/portrait second. Build a ton of emulators with a ton of different screen sizes, including tablets. Those are my priorities. You can always make someone use something that works in the orientation they dont want, but you cant make them use something that doesnt work in either orientation.
The other comments here are all correct that it should work at all resolutions. If you want to know which ones you should focus on and make pixel perfect, use the Android Device Dashboard, which provides a breakdown of all the screen sizes and densities of the last week worth of Market users. This will let you know which screen types are especially worth targeting (normal hdpi and normal mdpi dominate at the moment)
http://developer.android.com/resources/dashboard/screens.html
I always design 768px X 1280px canvas size, this is about xHdpi resolution and you should resize all elements in canvas to 4 sizes or 5 which are mdpi,hdpi,xhdpi(baseline),xxhdpi,xxxhdpi(optional) then you have a device independent design for your app.
mdpi = 160dp = %50 (resize)
hdpi = 240 dp = %75 (resize)
xhdpi = 320 dp = %100 (baseline)
xxhdpi = 480 dp = %150 (resize)
xxxhdpi = 640 dp = %200 (resize)

Categories

Resources