As of API 26 and above, Android supports adaptive launcher icons, as such.
Here is how to implement adaptive icons in your Kivy application and export it using buildozer.
-
Generate Background and Foreground images (.png/.xml, as prescribed in link above). Background must cover the entire image (no transparency). Foreground can have transparency; 72dp on all 4 edges of the foreground will be cut off.
-
Open a New Project in Android Studio
- Select
app
folder - Click File --> New --> Image Asset
- Upload the Background and Foreground you generated.
Adjust as needed, and follow buttons to create the proper icon. Leave default name "ic_launcher".
- Copy contents of the
res
folder in your app in Android Studio (minus values and values-night) to~[app_name]/.buildozer/android/platform/python-for-android/pythonforandroid/bootstraps/sdl2/build/src/main/res
. Click and drag, "merge" folder contents if prompted.
- In
~[app_name]/.buildozer/android/platform/python-for-android/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml
- Line 59:
android:icon="@drawable/icon"
TO
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
- Line 100 (now 101):
android:icon="@drawable/icon"
TO (same as above)
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
- Remove
icon.filename
frombuildozer.spec