I’m going to use vector drawable feature for action bar icons and notification icon, on my app.
With the announce of Android N, one of his most important feature is Screen Zoom (on Accessibility Improvements section). Another interesting feature is Multi-window support (see link if you want more info).
Does this means that we should use vector drawable also for launcher icon and other images used on app?
Vector drawable is not supported for launcher icons. You are, however, encouraged to use it everywhere else.
You can use vector drawables as launcher icon if you follow these steps:
Place vector launcher icon under
drawabledirectory. You can’t place vector drawables in
mipmapdirectory because they will work only in API levels 21 and above. As you possible know it’s recommended to place PNG launcher icons under
mipmap-<density>directories instead of
drawable-<density>ones, and this matters because if you have a split apk build or use the new
aabformat to upload your app (“Google Dynamic Delivery”), both processes will remove all
drawable-<density>directories except the one for the current density.
vectorDrawables.useSupportLibrary = truein
defaultConfigsection if you set it earlier. This will enable build-time PNG generation for vector drawables for API levels lower then 21. If you do not remove this option than
android:iconattribute of the
<application>tag will load default Android “green robot” icon.
I tested it on API level 16 device and it works perfectly.
It seems vector drawables are now supported for launcher icons.
I have recently uploaded and published an app (to alpha) with a vector drawable as a laucher icon.