Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Notification Icon

Tags:

android

I am giving notification by a background service. In notification i am displaying an image , image dimensions are 15*15. But when image is showed it automatically streches to big size , so it became blur. I haven't specified the image size in my program. Why this is happening

like image 701
Durga Dutt Avatar asked Apr 27 '11 09:04

Durga Dutt


People also ask

Where are my notification icons?

The Notification Panel is at the top of your mobile device's screen. It is hidden in the screen but can be accessed by swiping your finger from the top of the screen to the bottom.

What is the meaning of notification icons?

Usually, the sequence of the icons indicates how new or old the notifications are. The most recent notifications are displayed on the far left. The status bar shows you the current time, the battery status, and the connections / © NextPit.

How do I change the notification icon on my Android?

1 Tap Notification Settings on the notification panel or tap the Settings app. 2 Tap Notifications. 3 Tap App icon badges.


2 Answers

Refer status bar icon guidelines: http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html

For hdpi status bar icon image should be 38px height (24x38),
mdpi - 16x25
ldpi - 12x19

like image 52
Pavel Alexeev Avatar answered Nov 15 '22 09:11

Pavel Alexeev


The small icons

Guildlines says 24x24, that is for mdpi.

Applying the conversion dp*density/160 you get these pixels resolutions:

ldpi 18x18
mdpi 24x24
hdpi 36x36
xhdpi 48x48

(The guidelines actually now list these 4 dimensions)

Dynamically sized large icons

If you're creating an image, or resizing an image to fix the large notification image area, you can get the pixel dimensions like so:

int width  = resources.getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
int height = resources.getDimensionPixelSize(android.R.dimen.notification_large_icon_height);

See https://developer.android.com/reference/android/R.dimen.html#notification_large_icon_height

like image 39
weston Avatar answered Nov 15 '22 08:11

weston