Why do I need round Icon for my react native app?

Viewed 2181

I have created a rounded icon for my app with name ic_launcher.png. I read that I must have ic_launcher_round.png too.

Why do I need that as my icon is already rounded. Will removing that cause any problem ? Can I remove this line also from andrid_manifest.xml ?

android:roundIcon="@mipmap/ic_launcher_round"
1 Answers

After Android 8.0 (API level 26) you can use adaptive launcher icons. To add an adaptive icon to an app using XML, begin by updating the android:icon attribute in your app manifest to specify a drawable resource. You can also define an icon drawable resource using the android:roundIcon attribute. You must only use the android:roundIcon attribute if you require a different icon asset for circular masks.

You can also define the background and foreground drawables as elements by enclosing them in and elements.

A simple way to generate a adaptive icons is in Android Studio.

Select App folder -> right click -> New -> Image Asset

Sample Image enter image description here

Sample Icon

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Related