Why Android Launcher picks a low-density icon? - android

I've created 2 kinds of launcher icons:
mipmap-mdpi (48x48)
mipmap-hdpi (72x72)
Now I'm checking out what kind of icon Lollipop's Launcher chooses. And it chooses the mdpi icon, and then stretches the icon up to 60x60px:
Demo:
The question is:
Why the Launcher picks mdpi instead of hdpi?

By default it takes the lower size icon.
So, if you want to use large pixel icon then give some different name.
for exp:
Use two icons of different size and give same name and put it to any extension folder like mdpi,ldpi,hdpi,xhdpi or xxhdpi. It will always prefer smallest size.

The launcher sometimes picks the mdpi icon instead of hdpi icon because of the custom theme applied on the device, or because of the custom launcher.
if you are using the default launcher by your device brand you can use some other custom launcher you will definitely be shocked to see the results

Related

Does Mipmap scale up or scale down?

I was researching a little bit on mipmap to learn more about it. However, I just ended up confusing myself even more.
In this post: Mipmaps vs. drawable folders
The reason they use a different density is that some launchers
actually display the icons larger than they were intended. Because of
this, they use the next size up.
Hence, I got the idea that with larger icons mipmap will use a higher density(scaling up).
But then in this post: Mipmap drawables for icons
However some launchers (shipped with some devices, or available on the
Play Store) use larger icon sizes than the standard 48dp. Launchers
use getDrawableForDensity and scale down if needed, rather than up, so
the icons are high quality. For example on an hdpi tablet the launcher
might load the xhdpi icon.
I concluded that for larger icons, mipmap will scale down the icons to provide higher quality.
And finally in this post:Mipmap drawables for icons by #Sergej:
What Android will do is, it will try to pick up the image from a
higher density bucket instead of scaling it up. This will increase
sharpness (quality) of the image.
Mipmap will use a higher density instead of scaling up for larger icons.
What is really going on? Thanks.
Update:
Also, in the second post Mipmap drawables for icons by #Kazuaki, I don't understand this
Different home screen launcher apps on different devices show app
launcher icons at various resolutions. When app resource optimization
techniques remove resources for unused screen densities, launcher
icons can wind up looking fuzzy because the launcher app has to
upscale a lower-resolution icon for display. To avoid these display
issues, apps should use the mipmap/ resource folders for launcher
icons. The Android system preserves these resources regardless of
density stripping, and ensures that launcher apps can pick icons with
the best resolution for display.
Even if unused screen densities are stripped, why would the launcher app have to switch to a lower resolution? The current resolution(whatever resolution it's using), isn't unused, meaning, it wouldn't be stripped and the launcher icon wouldn't have to switch resolutions.
How does this work? Thanks.
I think your confusion about #Kazuaki quote is the now deleted documentation, replaced by: https://developer.android.com/training/multiscreen/screendensities#mipmap
Like all other bitmap assets, you need to provide density-specific versions of you app icon. However, some app launchers display your app icon as much as 25% larger than what's called for by the device's density bucket.
For example, if a device's density bucket is xxhdpi and the largest app icon you provide is in drawable-xxhdpi, the launcher app scales up this icon, and that makes it appear less crisp. So you should provide an even higher density launcher icon in the mipmap-xxxhdpi directory. Now the launcher can use the xxxhdpi asset instead.
The mipmap directories provide that "do not remove when trying to make a smaller APK".
In my understanding, mipmaping is principally for scaling-down.
In OpenGL, you can set texture filtering modes. One for scaling-down (minification), another for scaling-up (magnification) (cf. An Introduction to Texture Filtering).
Scaling-down (GL_TEXTURE_MIN_FILTER):
GL_NEAREST
GL_LINEAR
GL_NEAREST_MIPMAP_NEAREST
GL_NEAREST_MIPMAP_LINEAR
GL_LINEAR_MIPMAP_NEAREST
GL_LINEAR_MIPMAP_LINEAR
Scaling-up (GL_TEXTURE_MAG_FILTER):
GL_NEAREST
GL_LINEAR
You notice that there are no options of mipmap for scaling-up, but those are for scaling-down.
So, in my understanding, if scaling-up/down is needed, the nearest higher density texture is chosen to scale-down. Only when the current magnification is higher than the highest density texture, scaling-up is done based on the highest one.

What is the right size for vector drawable icons?

What is the correct size to choose for Vector Drawable icons e.g. when importing them from SVG?
There is a lot of information about standard icon dimensions for raster icons, for example this site. However, I'm a little bit struggling to get icons imported from SVG appear normally, I'm basically determining them by trial and error.
Particularly interested in launcher and notification icon sizes. I've currently settled on 192x192 for launcher icons and 48x48 for notification icons.
Using a smaller size for launcher icons results in a blurred icon on my KitKat tablet and using a larger size looks bad as well.
But the notification icon still appears larger than in other apps so it should probably be something like 32x32.
You choose what is the best, what it depends on is the version of Android, the default is 24x24 dp

Get correct Laucher icon size on Android

I am working on an app which is able to add shortcuts icons to the homescreen.
What is the correct icon size for Android tablets? (Or better said, how to get it at runtime?) It seems to differ from what is written on this page.
I have switch on DisplayMetrics.densityDpi and change the icon size accordingly. But it does not work for all devices..Gnex seems to be ok, but my Galaxy Tab while beeing DisplayMetrics.DENSITY_MEDIUM device displays only 48x48px icon (as it is in guidelines), but usual launcher icons are 72x72 pixels and not 48x48 - it differs from guidelines? Is it possible that it is related to TouchWiz UI and thus it differs from pure Android? Or where is the problem? Also good to note, that apps itself displays correct launcher icon (it takes the icon from hdpi folder), but at runtime it looks like it is mdpi device:/
Thanks
Android tablets looks one bucket up, when looking for launcher icon..That means mdpi device will actually look into hdpi folder..
This code returns correct size for launcher icons
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
int iconSize = am.getLauncherLargeIconSize();
Answer is based on this g+ post by Nick Butcher
best thing you use the android assets studio tool for this task .
it will automatically create the correct sizes and put them in the correct folders .

Android menu icon smaller in honeycomb

I've created a menu icon and included a 36x36, 48x48 and 72x72 in the ldpi, mdpi and hdpi drawable folders. It looks fine on all devices except honeycomb tablets, where it seems like the padding around the Android icons are bigger than on my custom icon. I've included a screenshot (see how much bigger my 'Resume Reading' icon is than the android 'Back' and 'My Library' icons are). How do I make my icon look like this?
I think I found the problem. When using the Android resource icon's on a tablet, I think it changes the padding in order for the icon to be used in the action bar. So when displaying them in a pop up menu at the bottom they are appearing much smaller than they should be. The solution is to copy the android resources into our own resource folder as it says to do here http://developer.android.com/guide/practices/ui_guidelines/icon_design_menu.html
Most of your Tablets are not hdpi, they are xhdpi. While the Icon Design Guidelines are useful, they don't give the whole story. Consider reading Supporting Multiple Screens. Here, they tell you further ratios and dimensions. To save you some time, resources should be 3ldpi:4mdpi:6hdpi:8xhdpi meaning that your xhdpi icon should be 96 x 96. Please, read the whole document, though. It is insanely useful.

Android: My 48x48 Launcher Icon looks smaller when compared to others

I have designed a launcher icon 48x48 pixels and placed it in my res/drawable folder. When I install the application, the icon in the application menu seems to be smaller and it is wrapped in a box by default. Did I do something wrong? Any help is appreciated.
48x48 should be for a mdpi screen. What device are you displaying it on? Also, is it saved as a transparent PNG or a JPEG?

Categories

Resources