Skip to content

Implementing Android Adaptive Icons

Collin Shumaker edited this page Feb 23, 2021 · 1 revision

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.

  1. 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.

  2. 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".

  1. 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.

  1. 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"

  1. Remove icon.filename from buildozer.spec
Clone this wiki locally