Is there a minimum SDK required for using Mipmap folders for launcher icons?
Asked Answered
T

1

7

I've read about the mipmap folders for launcher icons in Managing Launcher Icons as mipmap Resources and How should we use the mipmap folders added with android 4.4?.

Is there a minimum SDK version required to use this? Is there a specific target sdk below which this won't work? I'd like to support:

<uses-sdk
   android:minSdkVersion="10"
   android:targetSdkVersion="19"/>

Usage of mipmap launcher icons before Android 4.2? has a similar question, but no definitive answer. If I need to support Android 2.3.4 should I put launcher icons in the mipmap folders and in the drawable folders?

Thruway answered 28/4, 2015 at 15:20 Comment(1)
So I have the same question, as I need to publish update to users, did you notice any crashes with 2.3.4 while using mipmap for launher icons ? I need to support from 2.2 onwardsHarl
B
3

Since R.mipmap was added in SDK 11 or Honeycomb as seen in Android docs, I would say that the minimum SDK to use Mipmap folders in Android is SDK 11. This means you will need to keep using the drawable folders if you wish to keep supporting Android 2.3.

Edit: So I have been doing some digging into AOSP and it seems to come with a MipmapDrawable class since Android 2.1. The class was then hidden for Honeycomb's more integrated Mipmap resource system.

Boiney answered 28/4, 2015 at 16:27 Comment(2)
Good point. I see that now in developer.android.com/reference/android/R.mipmap.html. However, I am not referencing the launch icon in code, so I don't need the R.mipmap constants. I reference it only in my manifest as android:icon="@mipmap/icon". I just tested this on Android 2.3.4 and it appears to work correctly. Could it be that the resource packager doesn't care what the folder name is (as long as the @named folder exists) and it just works?Thruway
It maybe that the resource packager is somehow ignoring the folder name or the version of Android you have has the Mipmap code compiled into it. I would still be a bit cautious since back in the Gingerbread days, there was a lot of fragmentation within the Android ecosystem.Boiney

© 2022 - 2024 — McMap. All rights reserved.