Definitive android screen sizes - android

I have looked at the pages here on stackoverflow regarding this issue and followed up by looking at the links provided as some of the answers provided but I am still very confused. I use Photoshop to develop my screen shots in my android apps. It breaks down to this, there are four folders in the res folder for the different phone types Small Medium Large X-Large.
If I want to create an image to be used as a background that fills in the background completely and I am creating that image in the default resolution on Photoshop of 72 pixels per inch, what methodology and dimensions should I use for each image?
The specification I use in the manifest file would be set up as fill parent for both width and height.
I do understand there are many types of phones with different screen sizes but I need the most generic
As I understand it the images will be resized to fit screens but I that in itself leads to the creation of strange images if the original is not originally setup to be somewhat close.
So I need the somewhat close dimensions of a typical background image for each folder.
Small -> X_Dim x Y_Dim
Medium -> X_Dim x Y_Dim
Large -> X_Dim x Y_Dim
X-Large -> X_Dim x Y_Dim
Four folders four sets of dimensions
Again I am using Photoshop and 72 pixel/inch

The screen sizes are different concept with screen dpis
So, based on your question the most generic screen resolution for each dpi are:
ldpi 240 x 320px
mdpi 320 x 480px
hdpi 480 x 800px
xhdpi 720 x 1280px
I am talking about the generic screen resolution that each ldpi/mdpi/hdpi/xhdpi commonly has, so if you could create assets with these four sizes, it will fit most devices.

Related

minimum pixels of the largest image's side to fit android xxhdpi screen

I'm making an android App that shows images at full screen.
I learned some about dpi and dp, but I didn't find how many pixel must be the largest side of my images (in prospective to good fit also in landscape mode) to appear good in different devices.
As in the documentation, the most used screen configurations are normal with hdpi, xhdpi and xxhdpi density:
So, if my thinking is correct, I can make only one image to fit the xxhdpi to works fine also with the other two densities, and put it in Android Studio under the "res/drawable" folder (without qualifier).
Specifying the image size in dp in the layout, Android should scale the image for the smaller configurations.
But, for the xxhdpi, how many pixel must be the largest side of my image, in pixel, to show good?
Edit: how many pixel must be the longest side of my image to be showed properly in a device with xxhdpi density without the image appearing grainy?
All images are photo, not icons, so I can't use the vector graphics.
By looking at the Android Documentation. One can estimate the size of the picture. look at below picture
So, your image resolution should be in similar resolution
LDPI: 200 X 320px
MDPI: 320 X 480px
HDPI: 480 X 800px
XHDPI: 720 X 1280px
XXHDPI: 960 X 1600px
XXXHDPI: 1440 x 2560px
A little bit of +/- won't affect the outcome because with these standard sizes the aspect ratio of any portrait picture should be respected.
Well, if you put the image which fits the xxxhdpi inside the folder drawable, then it will fit all the screens.
But there is another way to use only one image instead of using multiple images for different resolutions. It's by using svg images which are vector images that will not be affected by zoom in or zoom out.
To use svg you need to follow these instructions:
Make the icon to be icon.svg
In the Android Studio, right click on drawable folder
Choose New -> Vector Asset
Choose Local File (SVG, PSD)
Choose your svg file
Click Next and choose the name
Click Finish
In the app build.gradle add the following inside android block:
vectorDrawables {
useSupportLibrary true
}
In the xml layout file, add the following:
<AppCompatImageView
android:width="wrap_content"
android:height="wrap_content"
app:srcCompat="#drawable/your_svg_file"
/>
Android have ratios defined for a image to set in all different drawables
Android icons require five separate sizes for different screen pixel densities. Icons for lower resolution are created automatically from the baseline.
mdpi: 160 dpi 1×
hdpi: 240 dpi 1.5×
xhdpi: 320 dpi 2×
xxhdpi: 480 dpi 3×
xxxhdpi:640 dpi 4×
Above size is for normal pixel icons. There are fix android size for Action bar, Dialog & Tab icons, Launcher icons & Notification icons
Check this link for more details http://iconhandbook.co.uk/reference/chart/android/
You have to take a look at the current market of smartphones.
Here you can see the screen sizes and resolutions of the most popular devices in the market.
http://screensiz.es/
Order the list in pixel per inch and you will see that top smartphones have resolutions bigger than 500 ppi or another way to see it, much bigger than 72ppi of your images.
If you have enough space to store or mechanism to download images try to test with full quality. If thats too much try to find a compromise. Lower image quality and see the result in high resolution screen.
Note that you didn't posted here the total size of image, in case is bigger than screen size, take a look at total size of image and compress it to fit your needs, maintaining as much as possible the resolution.
Edit: Looking only to size of image in pixels, the current biggest screen in smartphone is 2560 x 1440 pixels, so you wont need any image bigger than this.
If I understand your answer correctly, you are talking about images (pictures of lovely cats and dogs?) and not about icons?
I prefer putting images into the nodpi folder.
nodpi Resources for all densities. These are density-independent
resources. The system does not scale resources tagged with this
qualifier, regardless of the current screen's density.
Afterwards I would create a fullscreen ImageView and let imageView do the scaling if needed

Icons DPI for Android

I apologize for the simple question, but I am a bit confused.
I am creating my first Android app. Functinally I am done. I am now working on the UI. According to this, I am required to provide multiple icons to support different screens and I understand this part.
So I created a vector image, and was about to export it to generate a number of icons to support multiple resolutions. However, I could not find the require DPI. According to this, I am supposed to support different DPIs, but the article does not explain how to do that.
Can you please advise me on how to select the proper DPI? Does it even matter? I thought it does, but maybe my understanding is wrong.
Thanks.
EDIT:
Just to clarify my question. When I am exporting an image from a vector to a raster image, I have to select its dimension (so in my case, 400px X 200px), and its dpi. So what should I choose for DPI? Is that the same DPI that will create different icon sizes? I am confused. Thanks again.
For what concerns dpi, I use to follow the screen dpi:
640 dpi for xxxhdpi screens
480 dpi for xxhdpi screens
320 dpi for xhdpi screens
240 dpi for hdpi screens
160 dpi for mdpi screens
120 dpi for ldpi screens
This way I'm sure the icons are appropriate to the screen resolution.
I'm also sure that I can skip some (if not all) the lower qualities, once I have the highest resolution graphics, because they will scale down nearly perfectly.
But, since I'm a perfectionist, nearly disturbs me.
So, I do provide all the resolutions graphics.
For what concerns dimensions use this cheatsheet: http://petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/#dimensions
You can make this experiment:
for an xhdpi screen, prepare a 800px X 400px image at 72 dpi (and no other images for other resolutions) and see how does it scale down in a lower resolution physical device, say an ldpi screen (it will look really bad)...
Then prepare a 800px X 400px image at 480 dpi (and no other images for other resolutions) and, after scaling (will look very good, on the same ldpi screen), compare the result to the previous one.
The difference will be evident on a physical device, much less on an emulator.
It's a way of doing things when you want to save some bytes on lower resolution pictures: just prepare the highest resolutions ones and let Android scale them down (it will scale down the ones it doesn't find in their folders).
I am writing my conclusion for the greater good. After further reading and investigation. It appears that DPI is not important when I am creating an image for a screen. So when I choose 400px X 200px, and assuming this will be for mdpi, then I should choose 800px X 400px for xdpi (and so on and so forth). The dpi should be ignored in all cases (does not matter if I chloose dpi of 90 or 600, as long as this is not for printing). On the other hand, if I am to print the image, then dpi is important.
EDIT
This is a great article about the topic. Please read it, it explains things very well.

Android UI manually resize - Autoscale?

Well, I'm working on the UI for my Android app. And regarding the variety of screen sizes and resolutions, I'm following the known recipe:
MDPI 160DPI 1X (1px)
HDPI 240 DPI 1.5X
XHDPI 320 DPI 2X
Considering this scale, it means manually resize all my icons and buttons on Photoshop, and then load them into the respective folders (mdpi,hdpi and xdpi).
Do you do this in the same way? There is some sort of "auto scaling mode" or something on Android?
All the best,
If you don't want to generate all the icons for all dpi fragmentation, there's a trick. Just generate the icons for xxhdpi or xhdpi and add them into the respective folder. Android itself will resize them in order to fit another fragmentatios but remember that the scale is always done from bigger sizes to smaller, not in the other way.
Hope that helps

Android DPI independence on devices with same the resolution

I Have a few general questions about Android screen / DPI / resolution indepence.
Basically, I am taking specifically about sprite-based apps, like ones based on Surfaceview for example.
Every guide I've read (including the official one) says that you should only work with the DPI and not the resolution.
However, what happens when two devices have different DPI's/screen size but the same resolution? Take the Galaxy tab 10.1 (1280 x 800 - DPI aprox 150) and the Galaxy Note (1280 x 800 aprox 285 DPI I think??)
When displaying a sprite of say 50 x 50 on each of these, it will appear to be the same size relative to the screen size. However, if Android grabs a difference size sprite because it detects a different DPI (ie, from LDPI, HDPI etc), then the sprite will appear to be bigger on the Note relative to the screen size than it would on the Tab.
Can anyone please set me straight on this as I just cannot work it out!! Thanks all.
A 50 x 50 sprite on a 150dpi screen will appear much larger than a 50 x 50 sprite on a 285dpi screen. Android's resource resolution algorithm is intended to allow you to define a larger (in pixels) image for use on higher density screens.
If you want the sprite to be the same size relative to the screen regardless of the pixel density, then you can put the images in the drawable-nodpi folder and they won't be scaled by the system. You can even decide which size image to use in code after querying the screen size. (As of 3.2, you can have resource folders that depend on screen pixel size, but I think they will still scale with dpi.)
Screen resolution refers to the screen dimension in pixels. Pixel density refers to how many pixels it takes to fill an inch of screen.

Android: Multiple Image Density support - scale height width and dpi?

I have an android app that I'm trying to add support for different densities, screen sizes, etc. I've developed the app on the simulator with the HVGA support and used all icons from our iphone app which turns out nice since the resolution was at 320x480. Everything looks good now but I'm a bit confused after reading the official android documentation. For layouts I'm going through and ensuring everything is in dp units but when it comes to the images I'm lost. I know that mdpi is 160 but what do I tell my designer for what the hdpi image needs to be? Do we need to increase the height and width and the dpi? Or is it simply enough to leave the dpi as is and increase the height width? For example, if I have an image that's 100 x 100 with 160 dpi, in order to render it identical on an hdpi screen it should now be 150 x 150 with 240 dpi? Assuming if I leave the dpi at 160 it will just be a little blurred? Sorry about silly question but I just want to make sure I'm doing everything right and I'm really a C developer with no graphics experience at all.... No excuse at all but could use some help. I saw some examples where the splash screen for mdpi was 320x480 at 160 dpi but then the hdpi splash screen was at 480 x 800 at 240. Obviously 480 x 1.5 does not equal 800. Furthermore, after looking at the icons in the android sdk, they only scale up the width and height, not the dpi. Probably because they're icons and don't need to be? Lost in photoshop land....
For me as a Graphic Artist of a Mobile Development Company, I made UI's for Android in this dimension:
HDPI : 640px x 960px in 300dpi optimized by 75%
MDPI : 640px x 960px in 300dpi optimized by 50%
LDPI : 640px x 960px in 300dpi optimized by 25%
Take a look at Providing Resources.
There is a section there on "Screen pixel density (dpi)". You are correct that you just scale your width and height for the resources. A 90 pixel image at ldpi becomes a 120 px a mdpi, a 180 at hdpi and a 240 ad xhdpi.
You are also right that the 800 isn't 1.5 x the base 480 height. The reason for that is that these are all approximates based on targets for each density. The phone os lies to the applications running on it about its actual height and width and scales the resources to match the exact dimensions of the handset, since it can vary. This is my understanding.
I recently solved this problem by generating many PNGs of different sizes from a SVG vector image. These are the ratios I used for screen pixel densities and screen sizes:
ldpi:mdpi:hdpi:xhdpi:xxhdpi <-> 3:4:6:8:12
sw320dp:sw360dp:sw480d:sw600dp:sw720dp <-> 8:9:12:15:18
Putting these two together can give a 5 by 5 table of image size ratios that you need in make your image resources look great on most Android devices' screens. Of course, the downside is that many images will be generated, and the size of your APK will grow.
Please see http://aleakymemory.blogspot.com/2013/11/a-different-look-at-managing-android.html for the table of image size ratios.
Everything looks good now but I'm a bit confused after reading the official android documentation.
Which documentation did you read? Here are some to be going on with:
Supporting Multiple Screens
Icon Design

Categories

Resources