Android Icon Size – Launcher and Google Play Store
The icon for your app is quite important. It is the thing that represents your app on the Android device screen. Therefore, a professional and unique icon should be produced for your app. Making a set of app icons could be time consuming. However, Android Studio now has the Launcher Icon Generator to help with the process. Though using a graphics package like Inkscape to make Android icons can produce higher quality images. The Android icon size table in this article summarizes all the relevant information for the required icon sizes.
What is the Android Icon Size for an App?
Android launcher icons can be in jpeg (JPG) format, or more commonly in the Portable Network Graphics (PNG) format. For all the launcher icons you will need two lots of six sizes of PNG or JPG files. One set of six icons are square, plus for newer versions of Android, one set of icons are round. Also, there is the high resolution icon to be produced for the Google Play store listing. The six sizes in pixels are 36x36, 48x48, 72x72, 96x96, 144x144 and 192x192. The Play store high-res icon is 512x512. These sizes are the absolute sizes of the icons. It was recommended in the past to allow for a small margin, hence the area the icon is drawn in will be a bit smaller.
For the, now rarely used, low density screens the 36x36 icon is used. However, Android Studio will not generate the default 36x36 icon. Instead, if the app is run on a device with a low density screen, and the 36x36 icon is not present, then Android will use the 72x72 icon scaled down by half. If required, the 36x36 icon can be included in the app for completeness.
Android Screen Densities
The number of dots (pixels) per inch that an Android device's screen holds determines how sharp the image on the screen looks. The more Dots Per Inch (DPI) the sharper the image. Android will group screen densities into several classes, medium, high, extra high, extra extra high and extra extra extra high! These are referred to as MDPI, HDPI, XHDPI, XXHDPI and XXXHDPI. There is also a low density class, LDPI, however not many new devices have a low density screen and thus LDPI is no longer important. MDPI is around 160 DPI, HDPI around 240 DPI, XHDPI around 320 DPI, XXHDPI around 480 DPI and XXXHDPI around 640 DPI. (LDPI is around 120 DPI). It is the screen density that determines the Android icon size used.
Android Launcher Icon Name and Location
When a new Android project is created in Android Studio the launcher icon files are called ic_launcher.png and ic_launcher_round.png. You can choose to change the default icon using Android Studio's built in Asset Studio:
To use Asset Studio open it from within Android Studio using the New menu then select Image Asset. This allows you to configure the launcher icon based on different clip arts, images and colors. The various size icons are created and placed into various mipmap folders in the projects res directory. The folders are mipmap-mdpi, mipmap-hdpi, mipmap-xhdpi, mipmap-xxhdpi and mipmap-xxxhdpi. It you need a low density, LDPI, icon create and put a 36x36 PNG or JPG in a mipmap-ldpi folder.
(In older versions of Android the folders used to be named drawable, i.e. drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi, drawable-xxhdpi and drawable-xxxhdpi. For the very first version of Android, to support Cupcake devices, i.e. API level 3, a single drawable folder was used and contained the 48x48 MDPI PNG or JPG file.)
The square and round icons are referenced in the Android manifest. In the projects AndroidManifest.xml file the
<application ... tag has the
android:roundIcon attributes. These are set to
@mipmap/ic_launcher_round. The icon file name does not need to be ic_launcher or ic_launcher_round, it can be called something else. For example if all the icon files for the various sizes were called my_app_icon.png and my_app_icon_circle.png then the attributes in the application tag could be set as
Notice how the reference to the icon only needs the mipmap part of the folder name. Android works out the correct density icon to use. Android will also scale one of the other density icons if an icon at a certain density is missing (though that may result in a fuzzy icon being displayed on the screen).
Android Icon Margins
The Android Operating System (OS) has evolved since it was released. This means that the icon requirements have changed over the years. The main changes for icons are to support the increase in screen sizes and screen densities. Low density and medium density devices were common. Now high density and extra high density devices are the most common.
Previously it was recommend that the icon included a margin around one twelfth of the total size between the edge of the icon and the image it contained. For example the medium density icon is 48x48 pixels, one twelfth of this is 4, giving a margin of 4 pixels around the icon's image. This meant the area available for the image was 40x40 (48 minus the margin of 4 pixels on each side).
However, the bigger screens on today's devices gives more room for the icons so a smaller margin can be used, for example one eighteenth of the icon size. The use of a margin allows image spacing between the icons on a screen, and to allow for any drop shadows, or parts of an image that sticks out from main image content.
The High Resolution Application Icon needed for the Google Play store must be 512x512 in size. This image can have a margin to allow for padding or drop shadows, for example it could be 464x464 on the 512x512 canvas giving 48 pixels for padding and drop shadows. Again the size of the margin may depend upon the type of image being used, but the final file will be a 512x512 in size.
Android Bitmap Assets Ratios
With the 48x48 icon as baseline the 6 launcher icons have the ratios 0.75, 1, 1.5, 2, 3 and 4. These ratios apply to the screen densities. So a high density screen (HDPI) is 1.5 times a medium density screen (MDPI). I.e. 1.5 * 160 = 240. Likewise for the other densities. These ratios generally apply to all images used in an app that target different screen densities. If a bitmap is 100x100 on a medium density screen use the ratios to calculate the bitmap sizes required for other densities (75, 150, 200, 300 and 400 in this case). When generating icons and bitmap assets work at a high resolution and scale down, this prevents pixelation of the images. E.g. a canvas of 576x576 or 864x864 is good for design work. An art-board of those sizes is bigger than the biggest icon required (512x512 for the Google Play store). Even better use a vector drawing package such as Inkscape which effectively allows working at any resolution.
Android Icon Size Table
The following table summarizes the above information, remember to have one square and one round icon for the six screen sizes (or just five if not supporting the out-of-date low density screens).
List of Android Icon Sizes and Locations in the Apps Project
|Density||size||Location (under res)||Ratio||Screen||Margin|
|XXXHDPI||192x192||mipmap-xxxhdpi||4||640 DPI||12 to 16 pixels|
|XXHDPI||144x144||mipmap-xxhdpi||3||480 DPI||8 to 12 pixels|
|XHDPI||96x96||mipmap-xhdpi||2||320 DPI||6 to 8 pixels|
|HDPI||72x72||mipmap-hdpi||1.5||240 DPI||4 to 6 pixels|
|MDPI||48x48||mipmap-mdpi||1||160 DPI||3 to 4 pixels|
|LDPI (optional)||36x36||mipmap-ldpi||0.75||120 DPI||2 to 3 pixels|
|NA||512x512||Google Play||NA||NA||As required|
You will find a handful of Android icons used in Tek Eye projects on the Free Launcher Icons, Menu Icons and Android Graphics page, and of course many thousands more on the web.
- See the Tek Eye Android Studio example projects to learn Android app programming.
- For a full list of the articles on Tek Eye see the full site Index
Author:Daniel S. Fowler Published: