I was wondering, why are we using different launcher icons (sizes) in android. Currently you "have" to resize your icon to:
LDPI - 36 x 36
MDPI - 48 x 48
HDPI - 72 x 72
XHDPI - 96 x 96
And put them in the desired folder. But does it really matter if you would only put a xhdpi icon in your android application, and if you just leave the ldpi, mdpi and hdpi folder empty.
If you try the app with this configuration (only a xhdpi icon) on a mdpi device, automatically the xhdpi icon is used (I assume the device scales the icon automatically), and it looks just normal.
So what would stop us from only making a xhdpi icon. It will still result in a sharp app icon for every device (except xxhdpi ofcourse).
Rescaling overhead. Your icons may be used not only by your app, but also by few others. Like launchers, setting apps for installed software, share menus in many places.
Note that the higher the resolution, the more powerful the hardware. The lower the resolution, the less powerful the hardware. You may take an easy exercise. Open up an image in Gimp with resolution of 3000x3000. Scale it down to 50%. Even on a high end desktop it will take some time. Not long, but will.
As described here in the documentation provided by android it is better to use different variants of drawables mainly because of the following reasons.
Rescaling is an overhead for the mobile device's processor.
You will not get the perfect image when using on different phones because it will get pixelated or blurred.
You will have to handle the image sizes to fit in the layouts to give the same look and feel on all the screens.
Also creating one icon for xhdpi and using it for hdpi, mdpi and ldpi won't create sharp looking images. It will create drawables where pixels are overlapped on each other, giving the feel of a sharper image in hdpi but might not be viewable on either an mdpi or for sure on an ldpi screen.
Down scaling the images is as deteriorating in terms of quality as is up scaling.
So it is always better to have different launcher icons for different screens!
Although the system performs scaling and re-sizing to make your application work on different screens, you should make the effort to optimize your application for different screen sizes and densities. In doing so, you maximize the user experience for all devices and your users believe that your application was actually designed for their devices—rather than simply stretched to fit the screen on their devices.
This following five factor decide which assets is convenient to your device
Screen size
Screen density
Orientation
Resolution
Density-independent pixel (dp)
there are 2 main reasons that i can think of, and they are the same for any image and not just launcher icons:
scaling might ruin the output image. it might make it blurry, pixelleted , or lose the wrong pixels. when you create the exact icons you wish to use, you will always know what you get. this is because the images are not vector-based so they can't scale nicely.
here's a quote from the documentation:
To ensure your bitmaps look their best, you should include alternative
versions at different resolutions for different screen densities.
scaling takes CPU time from the device. sure, it might not be important, but it's something...
the disadvantage is that your app will take more space.
so, what i think is that for some images you should create all of the density screens, and for some you can use xhdpi or xxhdpi (or even hdpi) images and not use the others.
btw, there is also xxhdpi launcher icon which is 144x144 (see here)
Related
This is the question of its own kind may be some one has come across same condition which I have to face many times when it comes on UI and graphics.
And insist to forget about different screen sizes and resolution and just focus on the dps. Where as all the designers focus on the Resolutions and pixels.
So if I have to make the background screen for the splash activity so then What I am supposed to tell him If I want him to design for all folders I mean
mdpi, hpi, xhdpi , xxhdpi , xxxhdpi.
So first question is what size should I tell them to draw and for mdpi and hdpi and xhdpi and xxhdpi and xxxhdpi ? what should I tell them ?
Android designing is I think really very tough if you want to support different devices of different densities.
what would you suggest to make the the Graphics for all devices and what resolution should be the starting point ?
In the particular case of images that are meant to be backgrounds, it's okay to have a reasonably large image (1280x1920) and stick it in the drawable-nodpi folder.
Otherwise, for icons, your designer needs to learn about dp sizes. Then ideally they'll create a nice big high-res icon (say 512x512px), and either you or they will scale it to the appropriate sizes using something like Android Asset Studio
Tell your designer to make high resolution image,that means xxxhdpi or xxhdpi as per your requirement. so that we can converting it to lower resolution.
If you are using android studio then you can try this plugin.
by this you have to use Scaled Drawable import
hey everyone
I've been facing drawables and layout related issues for a few days....
there are drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi and drawable-xxhpdi folders in resources directory in android project
I've gone through the official android doc several times it definitely explains everything pretty welle.g scaling ratios for ldpi(0.75), mdpi(1), hdpi(1.5), xhdpi(2)but i couldn't find any information regarding which resolution to start with???
for example if i start designing graphics resources for xhdpi folder then which resolution i should go for???as there are many devices out there which lie in extra high density bucket but each having different resolutions, for example
Nexus4 (768x1280 xhdpi)
Nexus 10 (2560x1600 xhdpi)
Galaxy Nexus (720x1280 xhdpi)
same is the case with hdpi and mdpi bucket, lots of devices are there then which resolution images we should place in the corresponding folder????
please guide me guys m really in trouble
Look at #CommonsWare's answer.
I add that we are talking of dpi.
MDPI (160dpi)
HDPI (240dpi)
XHDPI (320dpi)
XXHDPI (480dpi)
XXXHDPI (640dpi)
Then:
to convert between dp and pixels use this formula:
px = dp × density ÷ 160
but i couldn't find any information regarding which resolution to start with?
For the vast majority of apps, if you are worrying about resolution, you are doing it wrong.
Ask yourself how you would write this as a Web app. Browser windows can have an arbitrary number of pixels of width and height, because the user can resize those windows as she sees fit. You are not going to design distinct imagery for a 1023x805 window instead of a 1037x740 window. Instead, you are going to take some approach that can handle a reasonable range of window sizes, perhaps with alternative artwork when you jump to a new range of window sizes.
Then, take that design approach, and apply it to your Android app. Focus on screen size and density, not resolution.
which resolution images we should place in the corresponding folder?
Resolution has nothing to do with density.
dpi has nothing to do with resolution. The dpi system is made so that a certain image will be (about) the same physical size no matter of the screen density, for example Google suggests that Buttons should be 48dp which is (about) 9mm on ANY density, but resolutions are different on any device, and including tablets you can't really worry about resolutions.
When making an app think about how you want to look, not in exact manners, for example "I want this line to have four buttons", make a LinearLayout with four buttons and you are done! (Sometimes you may want to include a horizontalScrollView depending on the size of the buttons).
Over time you will manage to understand this better, it's a matter of practise!
In my application I have to use hundreds of bitmap icons and we want to support multiple screen.
And through the documents at android developer, it seems that it is the only way to create these icons for different devices with different dpi.
If this is true, we will have a hard work, so I want to know if there is an alternative to avoid this?
Given the number of icons that you're dealing with, creating multiple versions of each manually is clearly out of the question.
I suggest that you create your icons at the xhdpi resolution, and come up with an automated process (perhaps using something like ImageMagick, and the scripting language of your choice) to produce the lower resolutions as part of your build process.
You don't have to provide different bitmap resources for all possible pixel densities, but ideally you would provide low dpi (ldpi), medium dpi (mdpi), high dpi (hdpi) and extra-high dpi (xhdpi) icon resources.
If you don't provide all of the above, the Android system will automatically pick the closest matching resource and scale it to match the actual screen pixel density.
Please visit Android Asset Studio wherein this site will provide all types of dp icon images of your requirement.
In your case, go for Generic icons section or Menu icons section.
Hope this helps.
You can put your images in /res/drawable, then Android would scale them according to dpi in order to keep the image to be roughly the same physical size regardless of display density. In this case an image would be unmodified in MDPI, 1.5x larger in HDPI, 2x larger in XHDPI, and 3x larger in XXHDPI.
You can also put them in /res/drawable-nodpi, in which case no image rescaling would be applied, but it is hardly ideal as the same image would be physically 3x smaller in XXHDPI than in MDPI.
All of the above methods have serious cons, so really the most sensible method is to put the correct sized images in their respective DPI folders. Your images should be drawn in a much larger resolution, so it should just be a matter of rescaling each image to different DPI sizes.
I start to design small app for android. But this is my first android app design. And I have a question about devices and displays.
I have read all developer guidelines at http://developer.android.com/, all about DPI and pixels. And still not clear with question.
I want to design in Photoshop CS6 because is the best way for me.
In guidelines i read "One approach is to work in the base standard (normal size and MDPI) and scale it up or down for the other buckets. Another approach is to start with the device with the largest screen size, and then scale down and figure out the UI compromises you'll need to make on smaller screens."
I want to start with the largest screen size so this is XHDPI 320DPI. As an example I want to choose Nexus 4. What resolution (pixels and DPI) do I need to choose for PSD?
I think I need to create PSD with 1280x768px and 320dpi. Is that right? If so, when I need to scale down to 160dpi I have to create new PSD with 160dpi and resize the elements from 320dpi?
Please help me someone I'm confused.
Density and screen size are not the same thing.
XHDPI is the density. 1280x768 is the screen resolution, NOT the screen size. The Nexus 4 has a 4" screen, which is considered "normal" size. If you had a device with an 8" screen and resolution 1280x768, it would be 160dpi, and would be MDPI. However, you can still use the 1280x768 asset you created for the Nexus 4 and the system wouldn't have to scale the image.
Here's how all this relates:
With the Nexus 4's "normal" sized screen, you can display all sorts of UI elements, keeping in mind that they need to be large enough to read, tap, etc. If you launched the same app on an 7" screen, which is considered "large" you might add additional UI elements, since you have so much more real estate. Ok so far?
Now, let's say the 4" screen and the 7" screen have the same resolution (1280x768), they will have a different density. The 4" is XHDPI and the 7" is HDPI (my Nexus 7 reports 213dpi).
If you had a 80x80 image, it would be 1/4" square on the Nexus 4, but 1/3" square on the Nexus 7. The whole UI would look larger and somewhat Fisher-Pricey. Thankfully, Android scales the UI for you, as long as you use "dp" to declare the size of UI elements. You can provide assets in different densities so Android won't have to scale bitmaps too much -- though it still will.
So, if you're developing a phone app, target the normal screen first (and XHDPI if that's your dev device), and provide all the assets in XHDPI. Then create alternate layouts for large screens if you want to make the UI more usable for tablets. Lastly scale your images for other supported resolutions.
You can use PSD, but personally, I prefer vector-graphics as they scale beautifully.
I'm not a PhotoShop user, but since it's raster based, I would start with a higher resolution than you expect using, and scale down. At the very least, I would design for a 1600x2560 Nexus 10, and then scale down from there. In my process, I use CorelDraw (long story), design icons in 1"x1" boxes and then export in the various resolutions.
a little more detail on what you are trying to do would be helpful. Are you trying to design your icons, or the entire UI, or what?
In android, the UI is designed mainly through xml, and the default styles should be used when possible to stay consistent with the rest of the OS and looking nice. For many apps, there is no real graphical work to be done accept maybe launcher icons, which there are guides on the developer site for.
If you are trying to design some of your elements like icons, figure out how big they would need to be on the largest screen size, and start from there. then you can scale them down, but you should not actually be drawing the whole UI or anything. Take a look at how the graphics are done in some of the android examples, I find them to be extremely useful when trying to figure out how to do things.
So, in regards to this stackoverflow accepted answer: How do I convert ppi into dpi for Android images?
So, ok, i make each background image the dimensions that that guy specifies in the answer.
BUT, if i define the other ImageViews (smaller ones), that are placed on the screen, in relation to the sizes defined above (e.g. let's say an ImageView has dimensions 20x20 for the hdpi devices, if i calculate this dimensions for the ldpi devices, the image would have to be 7x7 pixels, which is terribly small) then the ldpi devices won't be able to see anything on the screen :) Or will they? Am i doing it right, or not?
I'm terribly confused. Can someone clarify this for me please? :)
The resolutions mentioned in the other question will always fill the screen, but you should provide different layout files for each screen size to stay dpi independent (if you so wish).
Look at the example from the dev page
Also, it always helps to fire up the appropriate simulator (middle size with mdpi, smallest size with ldpi and biggest size with hdpi, depending on what devices you are planning to support) and try your layouts out.
Your images should be at least the size which can be easily viewable, or even clickable for the user on his/her devices.
The guidelines are for specific images, like launcher icons, or menu items, and not necessarily for any images you use in your app. For these kind of images, you are the best judge of specifying the image sizes and resolutions.
You could well have those images as only mdpi, and supply an hdpi version, so that it atleast has a higher resolution image for hdpi and xdpi devices.