So I am generating an Android notification and setting the small icon property to an image that is 400x400 pixels. The image looks as it's supposed to in the notification bar (see below - it's the yellow circle with green/red outline thing).
The problem is that when you pull down the notification drawer, the image for the notification's small icon is zoomed in and doesn't look as it should (see image 2). I want it to be that exact same image as the icon in the notification drawer, too.
Does anyone know why this happens / how to make the original image be the actual small icon?? Please let me know :( thanks.
According the Guidelines :
Notification icons must be 24x24 dp.
400x400 px sounds a very big size, i use in some applications the launcher icons, even the xxhdpi (144x144) and xxxhdpi (192x192) will load with no problem.
Related
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
I use notification in my app and I have problem with the icon of the notifications.
The problem is that when the notification received with the text the icon gets cropped and it looks very bad.
after the ticker ends the icon looks fine.
I added a image with how it's look when the notification arriving and after the ticker is finished.
I can't use notificationCompat because my app needs to support api level 8.
how can I fix this problem without changing the size of the icon to 36X36 px?
this problem only happens in nexus 4 and htc one, in all of the samsung devices i checked (s2 4.1.2, s2 4.0.3, s3 4.1.2, s4 4.2.2, galaxy y) it works fine.
thanks in advanace
Edit:
I managed to make the notification not to be cropped.
BUT! when I add ticker Text (which is something I must add) the notification gets cropped again.
What could make that happen?
notification icon must be 24x24 dp for optimal solution on most devices.
see
http://developer.android.com/design/style/iconography.html#notification
or create the following notification sizes:
96x96px in drawable-xxxhdpi
72x72px size in drawable-xxhdpi
48x48px in drawable-xhdpi
36x36px in drawable-hdpi
24x24px in drawable-mdpi
18x18px in drawable-ldpi
also it better to centerized your icon in the middle of the icon image with transparent space around it.
Google has updated their icon design page, here is another link that shows the optimum icon sizes for you app resources.
http://www.creativepulse.gr/en/blog/2014/icon-sizes-for-android-apps
If you're using Eclipse, you can create notification icon set via standard wizard.
Go to File->New->Other
Select Android->Android icon set
Select "Notification Icons" option, enter resource name and press "Next"
Choose "Image" for Foreground and browse for your icon file
Press "Finish"
The wizard will create a drawable resource which you will use in setSmallIcon(). I created my notification icons in such way, and it looked fine with the ticker.
I have been developing apps from the last 3 years, i have placed app icon of exact 72x72 and 48x48 into mdpi and hdpi folders
but still it does not cover the full width and height of the app icon on the screen,
any one guide me what could be the issue(see screenshot with white area around app icon)
any help would be appreciated.
the icon should be a png with transparency.
it looks like your icon has a white background.
Thank you for all helping me in this issue:
finally i resolved this issue myself:
actually my app icon was in resolutions 48x48 and 72x72 with transparent background but still it was showing white line around it.
looking into this issue in more detail i got to know that there was 2-3 pixel transparent gap in that icon around it and android was rendering it like a white background around it.
expanding image 100% left,right,top & bottom resolved my problem.
I have a drawable-xhdpi-v11 folder containing a 48x48 icon which is used in my Notification:
Notification notification = new Notification(R.drawable.ic_not_logo, null, now);
I noticed on my Galaxy Nexus running JB, the icon is shrunk to 36x36, making it blurry. Why does the documentation ask for a 48x48 if it wants a 36x36? Am I missing something? Is there a way to make my notification icons pixel perfect?
EDIT:
Here is a related post
Android status bar expects icons of size 25x25dp while guidelines recommend 32x32dp. Who is wrong?
The answers in this post do not explain why it still asks for a 48x48 sized icon and down scales it to 36x36.
You should provide different version of the very same resource.
Follow the guide: android design status bar
My final conclusion is that it is impossible to have pixel perfect Notification Icons. I experimented with providing different sized icons to the drawable-xhdpi-v11 folder and it down-scales all icons provided regardless of their size, leading to a loss in resolution and blurriness of pixel perfect icons. Pretty disappointing.
You should definitely stick to the 24dp value from the guidelines, but you must provide an xxhdpi res (72px) which can then be used by Android to scale to 36px without blur. Same with app icons, some tablets use the xxhdpi res for the homescreen, even though the device is xhdpi.
I'm wondering if it is possible to make my own personal icon for when my app is running? I don't really want to worry about adding it to the notification scroll down menu. I just want the picture in the top left corner. Any help on how to go about doing this would be appreciated. Thanks
Actually it is possible to change the icon in the top left corner. You have to change the ic_launcher png file (in res/drawable). Don't forget to change it in the hdpi, mdpi and ldpi folder.
for mdpi it should be 100X100
for hdpi it should be 150:150
for ldpi it should be 75:75
Android screen sizes in Pixels for ldpi, mdpi, hpdi?
This is not possible. If you are going to have a Notification, you must have it in the notification drawer as well.