

Emoji: Emoji are already square images that are mobile friendly and can be decoded a million different ways.Game elements: Inventory items in a lot of games, like these Dark Souls items, are easy to set as icons because most are designed to fit into a square and transparent PNG images of the items are easily found on fan sites and game wikis.Large icon is an optional icon and is used to make the notification more personal or give it more information.Source: Android Central (Image credit: Source: Android Central) Small icon and large icon are different things! Small icon is a main App icon and is required. setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) Public static Bitmap drawableToBitmap (Drawable drawable) ) Second, convert the drawable to bitmap using Canvas: Here’s how to convert vector graphics image to a bitmap in Android.įirst, get a Drawable object from your vector file:ĭrawable largeIcon = getResources().getDrawable(R.drawable.more)

In case of vector files it will return null for shapes defined in xml drawable files. Normally with PNG and JPG files you would use codeResource() to set the resource as an icon. Vector XML files are of type Drawable and not Bitmap and need to be converted to Bitmap. You will need a Bitmap file in order to set a large icon for your Android notification. Read more about vector drawable resources and how to create them. Place this XML file under the folder res -> drawable in your project. Here’s an example of how an XML file with vector image of three dots might look.

We will be working with vector graphics and create a “More” icon with three dots in vector xml: In this post we will explore how to set a large vector graphics icon on an Android Notification.Ĭheck out the notification anatomy for more details.

There are several icons you can set on an Android notification: small app icon and a large optional icon for the body of the notification.
