Android notification large icon size

Android Icon Sizes Made Simple (4.1)

This article has now been superseded by the latest Lollipop 6.0 Android Icon Size Guide. Please click on the image below for the latest information.

What are Android Icon Sizes?

It is a simple question but even Android, who provide better documentation than most, seems to make you want to work a little for the answer. Fear not, I have done the work for you!

Android Icon Sizes – App Launcher

What sizes do I need for Android App launcher icons? If you want to design your own or commission a professional to design your custom icons, you really need to know the right sizes.

Quick answer: 48 px, 72 px, 96 px, 144 px, 192 px & 512 px (for Google Play Store).

What about the Google Play Icon?

Google play requires a single additional version of the Icon in 512 x 512 pixels.

Understanding Android Icon Sizes

Android approach their Icon Size documentation slightly differently to other platforms, concentrating on different pixel densities rather than the simple facts we want. However, it is worth taking a moment to understand why they use this approach.

As technology has progressed, manufacturers have brought out hardware with ever increasing resolutions and pixel density. An increase in pixel density or dots per inch (dpi), basically means more image information can be displayed with.

  • MDPI – Medium Pixel Density – also known as the ‘Baseline’
  • HDPI – High Pixel Density
  • XHDPI – Extra High Pixel Density
  • XXHDPI – Extra Extra High Pixel Density

Note: Android also supports low-density (LDPI) screens, but you normally don’t need to create custom assets at this size because Android effectively down-scales your HDPI assets by 1/2 to match the expected size.

Need an expert to design your Android icons?

We will create a design you love, that also converts more customers.

Android Icon Sizes – User interface

All Android icons follow the same scaling rules, so when creating your icon files you must make 5 versions to cover all the platforms available. The table below shows the pixel densities and icon sizes for the different types of user interface icons used by Android:

640 dpi

MDPI (Baseline) HDPI XHDPI XXHDPI XXXHDPI
Scale 1 x 1.5 x 2 x 3 x 4 x
DPI
App Launcher Icons 48 px 72 px 96 px 144 px 192 px
Action bar Icons 32 px (24px inset) 48 px 64 px 96 px 128 px
Small / Contextual Icons 16 px (12px inset) 24 px 32 px 48 px 64 px
Notification Icons 24 px (22px inset) 36 px 48 px 72 px 96 px

Whilst the user interface icons follow the same scaling rules as the app launcher icon, they also have some additional display rules of their own:

Android Action bar Icon Sizes

Action Bar Icons require a file size of 32×32 pixels at the baseline size (MDPI). However, the image itself must be no more than 24×24 pixels centred within the Icon file.

The Icon Design must be single colour #666666 with a transparency set to 60%

Android Small / Contextual Icon Sizes

Action Bar Icons require a file size of 16×16 pixels at the baseline size (MDPI). However, the image itself must be no more than 12×12 pixels centred within the Icon file.

The Icon Design must be single colour #666666 with a transparency set to 60%

Android Notification Icon Sizes

Action Bar Icons require a file size of 24×24 pixels at the baseline size (MDPI). However, the image itself must be no more than 22×22 pixels centred within the Icon file.

The Icon Design must be single colour white, #ffffff.

Android’s own icon guide can be found here:

I hope this Android Icon size guide has been helpful. Please let me know if there is something else you would like me to add or elaborate on. Thanks!

Need Android icons?

Let’s improve your sales with app icons that convert

Owner and creative director at Creative Freedom Ltd. Unbelievably cool icon design expert, husband, and father of two awesome girls. A proper decent chappy and thoroughly fab to work with. Ok, so I wrote my own bio…

30 thoughts on “Android Icon Sizes Made Simple (4.1)”

Thanks for the reply.

“Note: Android also supports low-density (LDPI) screens, but you normally don’t need to create custom assets at this size because Android effectively down-scales your HDPI assets by 1/2 to match the expected size.”

I’ll add that to the Blog post.

I hope that helps.

Hi guys. Is it possible to set the height of the app icon to match the height of the action bar?

Thanks for posting. I don’t work on App development, just design to spec but I believe if you try and use larger icons sizes in the Action bar (or anywhere else) Android will just scale them to the standard size.

So I would say a tentative no but an App Developer may be able to help you more.

Sorry but I don’t get the density-resolution-dp-dpi thing. So if I want to support all densities, I should make 5 files – 48X48px/72X72px/96X96px/144X144px/192X192px.

That’s fine, but what resolution in pixels/inch should I input?
Is it 72 for all of them as per default? Or is it 160/240/320/480/640 pixels/inch?

I really don’t get what values for width, height and resolution to input for each file in Photoshop new file window!

Anyone willing to explain and help?

I’ll keep it simple, just use 72dpi in Photoshop, along with the file dimensions in pixels.

Clear and simple. Thank you!

Thanks for this! Would be nice if you could include the inset/un-padded dimensions in your table too, e.g. for notification icons.

Also, the ‘Iconography’ part of the Android design docs says that notification icons should be white, not #666666. I’m not sure about transparency, I’ve taken a gamble on all pixels being either white or transparent and it looks OK.

Thanks for the notification colour correction, post updated. 🙂
If I can fit the inset dimensions in the table I will.

Nice and simple and extremely useful.
Thank you very much!

I wrote a command line tool which can convert icons automatically to the right sizes for the different screen densities and which also saves everything in the right directories – it even supports the version structure of androids res/ folder.

The main idea is to have one SVG file for each icon. You do not have to have different SVG files for the states (e.g. enabled and disabled) but you can use icon-converter to change one or more colors in the icon.
Having all the SVG’s, you can simply write a .sh script to “compile” all the icons at once, meaning that icon-converter creates all PNG’s with the given settings (density, colors, scale, even versioning is supported, renaming files so that you can find them after compiling). The PNG’s are then stored directly in the right drawable-directories. E.g. when you change an icon which has different states, you only have to execute your script once and do not have to export PNG’s by yourself.

Please have a look at this tool, there are some examples online:
iconconverter.android-msapps.com

It runs on Linux and Windows.

Thanks for that, sounds useful. What kind of sampling algorithm does it use?

The conversion from .SVG to .PNG is done by the command line tool “convert” (ImageMagic).
On top of this I implemented the “android rules” and the recoloring.

Источник

OneSignal Push Notification Service Documentation

OneSignal Help & Documentation

Welcome to the OneSignal New IA developer hub. You’ll find comprehensive guides and documentation to help you start working with OneSignal New IA as quickly as possible, as well as support if you get stuck. Let’s jump right in!

Android Notification Icons

Adding custom icons to some or all of your notifications. Works with Android (and derivatives like Amazon).

Icons are a way to provide a more unique, branded experience for your Android and Amazon app.

You may add a default icon that appears with every notification you send, or you may add icons to just certain types of notifications. The below tutorial shows you how to do both.

Android supports both Small and Large Notification Icons.

The small icon is displayed on the top status bar as well as the notification itself. By default OneSignal will show a bell icon, however we recommend you customize this so users recognize it’s a notification from your app. Note that Android only uses the alpha channel for the icon. It will display monochrome in the status bar but an accent color can be applied to the left side the notification itself.

The large notification icon will show up to the left of the notification text on Android 4.0.3 — 6.0 devices, and shows on the right for Android 7.0+ devices. If you do not set a large icon, the small icon will be used instead. OneSignal will auto scale large notification icons for you to prevent the icon from being cropped. The recommended size of the large icon is 256×256 pixels.

We strongly recommend adding default icons to every Android and Amazon app.

REQUIRED: Add every icon size listed below

You must add each image with listed size and alpha transparency.

For help generating images with alpha transparency, see this clipart link for examples in the Android Asset Studio.

Recommended

To quickly and easily generate small icons with the correct settings, we recommend using the Android Asset Studio. Use ic_stat_onesignal_default as the name.

If you prefer to create your own icons, you must make your icons the following sizes and make the small ones in white with a transparent background.

You must be sure the icon filenames are correct for Native, Unity, PhoneGap, Cordova, Ionic, PhoneGap Build (PGB), Xamarin, React Native, Ionic Package (Cloud Build)

Note: If you used Android Asset Studio for your small icon then this step may have already been done for you.

Required: Each name and pixel size must be present in the app.

If using Solar2D/Corona the file names and sizes are different, as follows:

Make sure the following paths exist, create any folders you are missing.

Required: Each image must be present in the following paths.

res/drawable-mdpi/ (24×24)
res/drawable-hdpi/ (36×36)
res/drawable-xhdpi/ (48×48)
res/drawable-xxhdpi/ (72×72)
res/drawable-xxxhdpi/ (96×96)
res/drawable-xxxhdpi/ (256×256) (Large Icon)

Assets/Plugins/Android/OneSignalConfig/res/drawable-mdpi/ (24×24)
Assets/Plugins/Android/OneSignalConfig/res/drawable-hdpi/ (36×36)
Assets/Plugins/Android/OneSignalConfig/res/drawable-xhdpi/ (48×48)
Assets/Plugins/Android/OneSignalConfig/res/drawable-xxhdpi/ (72×72)
Assets/Plugins/Android/OneSignalConfig/res/drawable-xxxhdpi/ (96×96)
Assets/Plugins/Android/OneSignalConfig/res/drawable-xxxhdpi/ (256×256) (Large Icon)

PhoneGap, Cordova, Ionic, Intel XDK

/platforms/android/app/src/main/res/drawable-xxxhdpi/ (256×256) (Large Icon)

PhoneGap Build (PGB), Ionic Package
(Cloud Build)

/locales/android/drawable-xxxhdpi/ (256×256) (Large Icon)

See this github link for more details on the directory structure if you’re having issues.

android/app/src/main/res/drawable-mdpi/ (24×24)
android/app/src/main/res/drawable-hdpi/ (36×36)
android/app/src/main/res/drawable-xhdpi/ (48×48)
android/app/src/main/res/drawable-xxhdpi/ (72×72)
android/app/src/main/res/drawable-xxxhdpi/ (96×96)
android/app/src/main/res/drawable-xxxhdpi/ (256×256) (Large Icon)

Add files to root (all sizes)

Resources/drawable-mdpi/ (24×24)
Resources/drawable-hdpi/ (36×36)
Resources/drawable-xhdpi/ (48×48)
Resources/drawable-xxhdpi/ (72×72)
Resources/drawable-xxxhdpi/ (96×96)
Resources/drawable-xxxhdpi/ (256×256) (Large Icon)
Screenshot

Issue with Older Versions of Cordova

With versions of Cordova before 7.0, you will need to use

/platforms/android/res/drawable-/
instead of the path shown above when adding the icon resource to config.xml

Add the following lines to your config.xml under the Android section.

Troubleshooting Icons Not Showing

If you see the default OneSignal bell icon, you did not add all icon sizes. Please add all icons sizes and correct paths.

If you see a solid square, you set the image to the correct path, but the image does not have alpha transparency. For more help, try using images from this Android Asset Studio clipart.

You should be all set with your new default icons.

Optional

After you’ve added your default icons, you may choose to add more non-default icons. These will let you show different icons depending on the types of notifications your app sends. For instance, a game with a title like «Jewel Breaker» may wish to have a different colored jewel icon for every notification sent that represents the player’s level. Meanwhile, a social network may wish to show a chat bubble icon when the user receives a message from another user to differentiate those notifications from more generic system notifications.

OneSignal supports overriding default icons on a per-message basis.

Follow the steps above to generate icons and place them in the appropriate folder for your SDK.

To add non-default icons, you must name them something other than the default names specified above. For instance, you may name one message_icon .

If you’ve followed the above steps for creating default icons, and have updated your app, you’ll be able to reference those icons when you send a notification. To send a notification with a custom icon:

  • Dashboard: Messages > New Push > Platform Settings > Google Android Options > Set the icon name without the file extension. With Large Notification Icons, you can also supply a URL where the icon will be displayed from.
  • REST API: Instead of sending via the dashboard, you can send notifications with icons in the REST API by using the appropriate parameter and file extension depending on your platform (see more in Create notification REST API docs).

Android 5.0+ enforces your icon to only be white and transparent however it still allows tinting on the notification shown in the shade, known as the «accent color». (The status bar icon color will still be unaffected). These may be adjusted in Messages > New Push > Platform Settings > Google Android Options or as defaults in your manifest.

To set a default color add the following line to your res/values/strings.xml file in your project.

  • If you want a different color for dark mode add the key to your res/values-night/strings.xml as well.

To set the color on per notification bases set android_accent_color on our Create notification API call, or enter a value in the Accent color field under Messages > New Push > Platform Settings > Google Android Options.

New icons take a while to propagate to all users

If you’ve very recently added an icon resource to your app, you may want to wait a few days before sending notifications using the icon. This is because it can take many days or even weeks for the majority of your users to update their apps to the latest version which contain your new icons.

Some device manufactures display the image as-is (basically ignoring the alpha channel rule). You can setup a custom notification layout based on Android’s documentation if you wish to use non-alpha channel images across all devices.

We highly recommend following the alpha rule as the icons may not look consistent on all devices. Google designed it this way as the icon is small enough you can’t see any meaningful detail, so enforcing a single color helps enforce an easier to recognize icon at a glance.

Updated a day ago

What’s Next

Learn about setting up more features, or start using the OneSignal Dashboard

Источник

Читайте также:  Телевизор панасоник андроид тв
Оцените статью