Launcher icon gets chosen from different drawable density folder - android

So I am having a weird problem. I was redecorating my app for devices that fall under the screen density of extra extra extra high dots per inch (xxx-hdpi). I created a new folder namely drawable-xxxhdpi and put my launcher icon ic_launcher.pngwith the size of 192 x 192 px. But, when I compiled the app and ran it in my Nexus 5, the app would pick icon resource from drawable-xxhdpi folder. (I know that because all the other app icons are bigger and I checked their compiled .apk file to confirm their presence in the respective drawable folders.
It gets weirder: when I removed the launcher icon from drawable-xxhdpi and put the drawable-xxxhdpi icon in former folder, Android WOULD pick that icon up and show it as the launcher icon.
And apparently, I'm not the only one having this problem.
So, what to do about it?
Edit: On second thought, Nexus 5 ought to fall under the category of xx-hdpi devices (480dpi) but why do all the other apps have bigger icons (the ones used in xxx-hdpi)?

Related

Resource folder for Samsung Galaxy Tab E SM-T561 Tablet

Hi I have developed android application for mobile, now we have the application to to Samsung Galaxy Tab E SM-T561 Tablet which is the resolution of 1280*800. Please anyone suggest me the below requirements:
layout folder name.
drawable folder name.
strings values, color and dimen values etc...
Easiest way is to download whats my size app from play store and open it
on Top what ever is seen thats the width of the screen
so you can name the layout as
layout-sw320dp
change the value to what ever is yours
NOTE: if you place a folder name with layout-sw320dp and there is no other folder greater than that value then all screens whose small width is greater than 320 will also pick from this folder
whats ever is xhdpi thats your screen resolution so you can name drawable folder as
drawable-xhdpi
replace xhdpi with your resolution
but i cant see why you neeed seperate string,colours? they will be same for all screens
the values folder can be similar to layout folder like
values-sw320dp

Why Android Launcher picks a low-density icon?

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

What's the real size of the launcher icon on nexus 5?

As the doc mentioned,the launcher icon is 48*48dp.
So I think the launcher icon should be 144 * 144px on my nexus 5.
But I research a screenshot of my nexus 5,I find it's almost 166* 163px.
Why it's bigger than 144*144px?
Is my method of calculating the size wrong?
(p.s. an app with a 144*144px icon in the drawable-xxhdpi folder is also shows 166* 163px in the launcher.)
This is my screenshot:
Per the info provided by someone working at Google, Nexus 5's launcher uses the launcher icon in the next DPI bucket, i.e. on Nexus 5 it will use one DPI bucket up XXHDPI --> XXXHDPI, which makes the icon 192x192. The reason why your measurement is less than 192 is because the launcher icon graphics is not supposed to fill the whole image.
Nexus 5 is XXHDPI device.These device DPI are around 440. So, Google Nexus 5 need to add a 144*144px icon in the drawable-xxhdpi folder.

How to clarify what my apps icons are - Android

I have 2 questions,
Okay so I have read online what sizes I should make my app icons for certain size phone screens. I know how to clarify what the launcher Icon is for my app with this code,
android:icon="#drawable/icon"
My app image is 72px x 72px. So its placed in the drawable-hdpi folder. Then I have a 36px x 36px icon for low density screens which is placed in the drawable-ldpi folder. So, for the 36px x 36px icon, should it be saved in the drawable-ldpi folder as icon? Cause wouldn't this cause an error because 2 files will be named the same thing?
Second question is my app launcher icon is saved in the drawable-hdpi folder. I read online that I also need an action bar and status bar icon, both have to be 36px x 36px. Where do I save these files at? In the drawable-hdpi file for high resolution screens I assume, but what do I name them? Do I have to clarify them in the android manifest file? How do I do so?
It would be better if you forget px when talking about Android drawables and think in dp instead. Launcher icon is 48x48dp, so (48px on mdpi, 72px on hdpi, etc.)
So, for the 36px x 36px icon, should it be saved in the drawable-ldpi folder as icon?
Yes.
Cause wouldn't this cause an error because 2 files will be named the same thing?
No. Android nicely handles same resource for different configurations even if you have folder with name drawable-large-land-fr-xhdpi or something like this. It tries to take the best match from its configuration.
I read online that I also need an action bar and status bar icon, both have to be 36px x 36px.
It's always good to provide source, which seems to be giving false statements. You can read on Android Developers that action bar icons have to be 32x32dp and notification 24x24dp. And you don't need them if you don't use them.
Where do I save these files at? In the drawable-hdpi file for high resolution screens I assume, but what do I name them?
You can name them anything you like (you don't need to name your app icon as icon.png).
Do I have to clarify them in the android manifest file?
No. You put them when you use them. For action bar icons that would probably be in menu.xml.

Kindle Fire homescreen app. icon

on my Kindle Fire home screen the icon of my application sometimes is shown as a plain gray square. Rebooting device returns normal application icon back. is it a known issue on Kindle fire?
Kindle shows the image uploaded on amazon market to show on home screen, you can add a app as a favorite and it will show you the app icon mentioned in manifest, please make sure you have a high res image uploaded on amazon market as thumbnail. side loaded app cannot use this feature
The way I solved this is to put in 512x512 icon. I know it's not pretty, but it gets job done, as all Android devices resize icons to appropriate size.
If somebody has better solution that doesn't involve uploading app to Amazon Market - please let us know.
Do you have the MDPI, HDPI, and XHDPI icons all going? I think it might be showing a grey box because one of those isn't in there.
(If you submitted your app to the app store, it's the HDPI icon. If you didn't, it's the MDPI icon. Because of this, it might be getting confused as to which icon to get. Also, you can replace your MDPI icon with a 200x200 image to make it appear hi-res in the Kindle Fire.)
I believe the best solution is to use custom drawable folders for kindles
custom drawable "drawable-1024x600-v10" with ic_launcher.png for KindleFire 1 st Gen
custom drawable "drawable-1024x600-v15" with ic_launcher.png for KindleFire 2nd Gen
custom drawable "drawable-1280x800" with ic_launcher.png for KindleFire HD-7'
custom drawable "drawable-1920x1200" with ic_launcher.png for KindleFire HD-8.9'
Using these drawable folders will ensure that the kindle icons will look good. meanwhile use your standard Android icons in the standard drawable folders.
ldpi (120 dpi) (Low density screen) 36 x 36 px
mdpi (160dpi)(Medium density screen) 48 x 48 px
hdpi (240 dpi)(Highdensity screen) 72 x 72 px
xhdpi (320 dpi) (Extra-high density screen) 96 x 96 px

Categories

Resources