Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
1

Android 8.0 adaptive icons support

Contributor ,
Jun 14, 2018 Jun 14, 2018

Since releasing an Android build supporting api level 27 we notice our app icon is displayed smaller and in a white frame on Android 8+ devices, because of this:

Adaptive icons  |  Android Developers

We can probably work out how to add in the right resources to fix this, but naturally it would be more convenient if the SDK handled it, as well as for apps that don't use inhouse ANEs etc.

TOPICS
Air beta
2.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 15, 2018 Jun 15, 2018

For anyone who's wondering, this turns out to be not that hard - you can import your foreground and background in Android Studio, rename "ic_launcher" to "icon" wherever it appears as the default name,  and then include the files in the res/ folder it produces as android resources - if you're using ANEs, you can package the resources in one of them (if not I guess you can use aapt and resign the apk) and they'll show up in Android 8.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2018 Jul 03, 2018

Hi ,

what do you mean by "import your foreground and background in Android Studio" ?

Gili

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 05, 2018 Jul 05, 2018

instructions here:

Create app icons with Image Asset Studio  |  Android Developers

you can just create a fake Android Studio project and copy the directories/files it creates.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 03, 2018 Sep 03, 2018

To fix this problem we added adaptive icons manually. And adjusted the jenkins pipeline to resign app after changing content.

It looks like that:

cd $WORKSPACE/build/

rm -rf $WORKSPACE/build/App-release

apktool d App-release.apk

sed -E 's/android:icon="@mipmap\/icon"/android:icon="@mipmap\/ic_launcher" android:roundIcon="@mipmap\/ic_launcher_round"/' App-release/AndroidManifest.xml > App-release/AndroidManifestModified.xml

rm App-release/AndroidManifest.xml

mv App-release/AndroidManifestModified.xml App-release/AndroidManifest.xml

sed -E 's/<\/resources>/    <color name="ic_launcher_background">#ff005878<\/color>\'$'\n''<\/resources>/' App-release/res/values/colors.xml > App-release/res/values/colorsModified.xml

rm App-release/res/values/colors.xml

mv App-release/res/values/colorsModified.xml App-release/res/values/colors.xml

cp -R ../manual_content/android_res/res/* App-release/res/

apktool b App-release

jarsigner -verbose -keystore ../cert/android_release.p12 -storetype pkcs12 -storepass PAS$WORD App-release/dist/App-release.apk "ALIAS NAME FOR KEY"

jarsigner -verify App-release/dist/App-release.apk

../tools/android-sdk-macosx/build-tools/24.0.3/zipalign -v 4 App-release/dist/App-release.apk App-release/dist/App-release-resigned.apk

rm App-release.apk

cp App-release/dist/App-release-resigned.apk App-release.apk

In res folder we store

mipmap-anydpi-v26 with two xml files created from Android Studio Asset creator

mipmap-hdpi with three files ic_launcher_foreground.png, ic_launcher_round.png, ic_launcher.png

mipmap-mdpi with same files but different size

and so on

mipmap-xhdpi

mipmap-xxhdpi

mipmap-xxxhdpi

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 20, 2018 Nov 20, 2018
LATEST

someone in the starling forums is reporting an even easier way:

Adaptive icons for Android « Starling Forum

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines