Pixel handling in Android - android

I am new to Android. Like in iPhone we have a standard pixel sized of 320*480 to work with on the screen. What are the specifications for Android based devices.

There are many different Android devices with many different screen sizes. You can read the official documentation for advice on how to handle these variations.
http://developer.android.com/guide/practices/screens_support.html

The variety is to large to limit your app like that. On iPhone you have two devices (now, also iPad), here you have a limitless number.
You would better use the DPI (density independent pixel) and also scale your image to the screen dimensions (gathered at run-time)
http://developer.android.com/guide/practices/screens_support.html

Related

Android Apps design resolution

I'm required to design an apps for android.
And after some reading, I find out android device are divided into few categories in term of resolution, like
small screen
normal screen
large screen
extra large screen
but in different density.
So lets say, now I need to come out a design for normal screen, what resolution that I should use for the "look & feel" of the apps UI.
From the reading, I know android apps are use dp instead of px. So, is it means I have to convert few specific screen size to dp before I start to design ?
Or I just simply target a common resolution for normal screen size like 320x480, provided I will have few set drawable in different density ?
Please correct me if I had mistaken it.
Thank you
Good question, so far we have 5 screen densities :
xxhdpi,xhdpi,hdpi,mdpi,ldpi , now if you have an image resource you will need to create 5 copies of it, its always recommended to start by the xxhdpi till you reach to the smallest,
however you can use online calculators that will calculate the PX and DP for all the densities, i recommend these two tools android developer toolbox and developers tools, and with developers tools you can test the colors, and how are they going to look like in the screen in HEX decimal.
Yes it is true android has following types of devices
LDPI
MDPI
HDPI
XHDPI
http://developer.android.com/guide/practices/screens_support.html
this link gives you all the description
and ya you have to create icons and images supporting to all the devices resolution wise.
There are various devices with various screen sizes.
Usually, they are mentioned as LDPI, MDPI, HDPI or XHDPI devices.
Although, in coding there are many things to be kept in mind so that you achieve a good uniform design in all your devices !
Refer to this link. It is always good to follow official sites, rather than other tutorials out there. Make a habit of using relativelayout !
Also in the link you can explore many things to get the knowledge of designing in Android.

How to handle splash screen stretched issue in Android? [duplicate]

My application is supporting 3 type of density ldpi (120),mdpi(160),hdpi(320) and for that we have three folder for resources (ldpi,mdpi,hdpi).
But my problem is occurring in HTC sensation XE (540x960) having density ~256 dpi.and my resources is stretched.
In manifest file
<supports-screens android:xlargeScreens="false" />
means i am not supporting for xlarge screen so does 540x960 come in high density??.
How can i overcome this problem???
Android Multiscreen Support issue says "You can also use a combination of density and size qualifiers but that still leaves some room for two different resolutions falling into the same bucket."
What should be the name of drawble folder for this kind of resolution??
or is there any other way to short out this issue.
EDIT : My problem is not with layout, my problem 540x960 come in HDPI but my hdpi drawbles are designed related to 480x800
Help me..
Thanks in advance..
you can use below combination for Layout for HTC sensation XE (540x960) :
res/layout-w540dp-h960dp/layout.xml
this will use for pick layout for this device and for drawable it will pick image from hdpi because in this developer site 256 dp come in range of hdpi . http://developer.android.com/guide/practices/screens_support.html.
hope this will help you.
Your problem is that you have designed your bitmaps for a particular screen size rather than screen density.
Plainly put, you should not do that. There are a huge number of different form factors and screen sizes out there, and you cannot hope to have graphics sized for all of them. So you fix this issue for 540x960 screens... what then with your users who are on 480x854 displays (most hdpi motorola devices)? Will you include different graphics for 1024x720 and 1280x720 displays if you're developing for that? What about 1280x800?
Granted - it can be a pain to deal with these issues, but that is the price we pay for diversity of devices. And Google has provided a fair amount of powerful tools at our disposal to deal with this.
When you are designing an app for Android, you need to think of the design as if you were designing a website - not a desktop (or IOS) program. All (or most) of the tricks that you use for designing a website also apply here - plus you have the density-awareness and 9.patch tools.
And if you really cannot adjust your graphics/layout to the screen without messing it up, you can always center the layout on the display (or align it left or right, depending on what you think looks best).
Edit:
As I mention above, the core to flexible UI design in Android is to think of your app like a web site. Roman Nurik has an article discussing this on the Android blog.
http://android-developers.blogspot.com/2011/09/thinking-like-web-designer.html
Apart from that, it is mostly covered by the Android site, etc.
http://developer.android.com/training/multiscreen/index.html
Using the right layouts and 9-patch images (not always - sometimes static images are better) will allow you to create designs that look good on all phones. But you have to realize that - like a website designed in a browser - you do not and can not have 100% control over how things are displayed on every single device. What you need to achieve is that it is still accessible and good-looking even when displayed on a device that you did not anticipate beforehand.
You have to name the drawable as per your pixel density and the screen size. The calculation is here...
dpi = sqrt (540^2+960^2) / 4.3"(Device size) = ~256 dp = px / (dpi / 160) = 540 / (dpi / 160) = 330
The drawable will be named as drawable-sw330dp. I have tested this. And this works good. No problem with other drawables either. Layout Will be layout-sw330dp
Or you can try this by drawable-sw540p. I haven't tested it yet. But I guess it will work good. Layout Will be layout-sw540p

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)

Dealing with device variations on Android

I'm an iOS developer and I'm looking into Android programming. On the iPhone I can count on pretty much one screen size on all devices, but that's not necessarily the case on Android.
How is that handled on Android? What if you need a widget to be at least some size?
Is it possible to specify a lower bound for Android devices that you can use your app? Can I say I'll only allow touch-screen devices with some minimum screen size and prevent people from purchasing the app if their devices don't meet the minimums I'm expecting?
Thanks!
Bill,
The android developers page has pretty good information on supporting the various screen sizes: http://developer.android.com/guide/practices/screens_support.html
And yes, you can limit your application to particular screen sizes via: http://developer.android.com/guide/topics/manifest/supports-screens-element.html
good luck!
You can restrict applications based on a range of enumerated screen sizes. The market will filter apps based on those.
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
Some widget design guidelines are available here. Please be aware that many custom home applications do not honor the standard sizes.
http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
You could specify minimum specifications for your app, but that's not necessary. The Android Developer Documentation states that applications don't work directly with resolution and pixels, but rather with density independent pixels that allow you to scale your applications across a range of screen sizes.
Android provides you with an API for getting the real pixel density of the screen as one of 4 categories (low dpi, medium dpi, high dpi, and extra-high dpi), so your application can choose to display the proper visual resources for a given pixel density. In addition, there are a number of best practices that you can use to ensure that your application scales nicely across screens.

How big is an android phone's screen?

How big is the smallest motorola android's screen, in pixels? I want to know what size I need to make my graphic without it being too distorted by the fill_parent.
Although this doesn't directly answer your question..
Android is the name of the operating system running on Android phones. Different phone models could have different resolutions and pixel densities. Therefore you have to be careful not to hardcode resolution values into your code. It might run well on one phone but poorly on another.
Check out these pages for details about supporting different screens:
http://developer.android.com/guide/practices/screens_support.html
http://developer.android.com/resources/dashboard/screens.html
It would be unwise to program for one screen size, especially if you plan on distributing your application later. You should design your application for as many screen sizes as possible.
Instead use nine-patch images and flexible layouts.
If you are designing an icon, the look at the android icon design guidelines and consider high, medium and low density screens. There are different resource folders for these too and android takes care of selecting the appropriate one for the current device.
motorola droid's display size is 480x854 px, according to specs, so it's rather non-standard

Categories

Resources