How to Set Launcher Icon in Android Studio: Guide
Step-by-step guide to set launcher icon for Android apps using Android Studio Image Asset Studio. Covers icon sizes (mdpi 48x48 to xxxhdpi 192x192), adaptive icons, densities, and manifest updates for perfect scaling across devices.
How to set a launcher icon for an Android application? Step-by-step guide including Android Studio, image requirements, and support for different screen densities.
To set a launcher icon for your Android app, fire up Android Studio’s Image Asset Studio—right-click your res folder, pick New > Image Asset, select Launcher Icons (Adaptive and Legacy), and upload a 512 × 512 PNG source image. It’ll auto-generate all densities like mdpi (48 × 48 px), hdpi (72 × 72 px), up to xxxhdpi (192 × 192 px), plus adaptive XML layers for modern devices, and tweak your AndroidManifest.xml. No more manual resizing headaches; just test on emulators for different screens.
Contents
Sources
Conclusion
What Are Launcher Icons?
Launcher icons are the first thing users tap on their home screen—those snappy little badges representing your app. They’re not just pretty pictures; they need to scale perfectly across phones, tablets, foldables, and even wearables. Get this wrong, and your app looks amateurish on high‑DPI beasts like modern flagships.
Android handles this through mipmaps: specialized drawable folders (mipmap‑mdpi, mipmap‑hdpi, etc.) that store resolution‑specific versions. The system picks the right one based on screen density, ensuring crispness everywhere. Why bother? Poor icons tank first impressions and Play Store approvals.
Android Icon Sizes and Density Requirements
Ever wondered why one icon blurs on your Pixel but shines on an older Moto? It’s density buckets: mdpi (baseline, 48 × 48 px), hdpi (72 × 72 px or 1.5×), xhdpi (96 × 96 px or 2×), xxhdpi (144 × 144 px or 3×), and xxxhdpi (192 × 192 px or 4×). Stick to a 2:3:4:6:8 ratio scaling for harmony, as outlined in community benchmarks from Stack Overflow.
For Play Store uploads, prep a 512 × 512 PNG—square, no transparency issues. Legacy icons go in mipmap folders per density; adaptive ones use vector XML for masks (circles, squircles). Pro tip: Start with a foreground logo around 48‑66 dp in a 108 × 108 dp canvas to dodge cropping.
But densities aren’t everything. Test on real devices—emulators lie sometimes.
Adaptive Icons Explained
Since Android 8.0 (Oreo), adaptive icons rule. They’re layered: a background drawable, a foreground icon, and optional effects, wrapped in XML like <adaptive-icon><background android:drawable="@drawable/background"/><foreground android:drawable="@drawable/foreground"/></adaptive-icon>. Drop this in mipmap-anydpi-v26/ic_launcher.xml for magic.
The safe zone? 66 × 66 dp centered in 108 × 108 dp, with your logo fitting 48‑66 dp. Devices apply masks—think rounded squares or circles—keeping things fresh. Set android:icon="@mipmap/ic_launcher" and optionally android:roundIcon="@mipmap/ic_launcher_round" in your manifest, per the official adaptive icon guide.
Why switch? Legacy PNGs pixelate or get butchered by masks. Adaptive scales forever.
Setting Up Icons in Android Studio
Android Studio’s Image Asset Studio is your best friend here—handles everything from resizing to manifest updates. It’s baked in, no plugins needed. Russian devs on Habr Q&A swear by it for quick swaps.
Right-click app/src/main/res, New > Image Asset. Boom—dialog opens with presets. Choose your source (PNG/JPG up to 1024 × 1024), tweak colors, add overlays. It spits out mipmaps for all densities and adaptive XML. Even generates Play Store assets.
Tired of defaults? Customize foreground/background separately for that pro sheen.
Step-by-Step Guide
Ready to swap that boring robot? Here’s the no‑fluff walkthrough, straight from the Android Studio docs.
- Prep your image: 512 × 512 PNG, transparent background, simple design. Avoid text—it shrinks tiny.
- Launch Asset Studio: In Android Studio, right‑click
resfolder > New > Image Asset. Pick “Launcher Icons (Adaptive and Legacy)”. - Configure layers:
- Foreground: Image > select your PNG > scale/position.
- Background: Color or image.
- Legacy: Auto‑generates PNGs.
- Name it: Default
ic_launcher. Hit Next—review densities (mdpi through xxxhdpi). - Finish: Studio creates folders, drops
ic_launcher.xmlin anydpi‑v26, updatesAndroidManifest.xml:
<application
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
... >
- Clean & rebuild: Build > Clean Project, then Rebuild. Install on emulator/device.
Done in under 2 minutes. If tweaking post‑generation, edit XML directly—vectors resize free.
What if you’re mid‑project? Same steps; it’ll overwrite safely.
Manual Method Without Asset Studio
Asset Studio down? Or want full control? Grab Stack Overflow’s tried steps.
- Resize manually: Use tools like GIMP or online generators for densities (48/72/96/144/192 px).
- Drop PNGs:
res/mipmap-mdpi/ic_launcher.png, etc. - Adaptive XML: Create
res/mipmap-anydpi-v26/ic_launcher.xmlwith layers. - Manifest: Add
android:icon="@mipmap/ic_launcher".
Vectors? Use SVG in foreground for scalability. But honestly—why fight when Studio automates it?
Testing and Best Practices
Build and sideload. Fire up emulators: Pixel 4 (xxhdpi), old Nexus (hdpi). Check home screen, app drawer, recent apps. Adaptive? Test Oreo+ with dev options > icon shape.
Design tips: High contrast, minimalism—think Material You vibes. No gradients that muddle on OLEDs. Validate with Play Console’s asset checker pre‑upload.
Common pitfalls? Forgetting roundIcon (crashes some launchers). Or mismatched densities—app looks jaggy. Iterate fast; users notice.
Nailed it? Your app’s ready to shine.
Sources
- Create app icons — Official Android Studio guide for Image Asset Studio and launcher icons: https://developer.android.com/studio/write/create-app-icons
- Adaptive icons — Detailed specs on adaptive icon layers, masks, and XML structure: https://developer.android.com/develop/ui/views/launch/icon_design_adaptive
- How to change the standard APK app icon made in Android Studio — Practical steps for res folder and Image Asset in Russian context: https://qna.habr.com/q/581434
- Android - Launcher Icon Size — Precise density sizes and scaling ratios for all buckets: https://stackoverflow.com/questions/12768128/android-launcher-icon-size
- How do you change the launcher logo of an app in Android Studio — Asset Studio workflow for icon generation: https://stackoverflow.com/questions/26615889/how-do-you-change-the-launcher-logo-of-an-app-in-android-studio
Заключение
Setting a launcher icon boils down to Android Studio’s Image Asset magic: upload, generate densities from mdpi 48 × 48 to xxxhdpi 192 × 192, embrace adaptive XML, and manifest tweaks handle the rest. Skip the guesswork—test across devices for that polished look. Your app’s first impression? Locked in. Now go launch something epic.