How can I add different icon sizes to my Xamarin Android project?

Kim Strasser 1,321 Reputation points
2021-11-18T09:04:10.21+00:00

publishing-to-google-play
I have read this Microsoft tutorial and they are adding different icon sizes to the Android project before they publish the application to Google Play.

Launcher Icons:
ldpi (120dpi) – 36 x 36 px
mdpi (160dpi) – 48 x 48 px
hdpi (240dpi) – 72 x 72 px
xhdpi (320dpi) – 96 x 96 px

But I don't know how to add more than 1 icon to my Android project. My Android project in Visual Studio for Mac looks like this:
150477-bildschirmfoto-2021-11-18-um-090534.png

How can I add launcher icons in different sizes to my Android project? Is it necessary to create new folders in Resources-->Drawable ?

Is it necessary to change something in my AndroidManifest.xml if I add different launcher icon sizes to my project?

In the Microsoft tutorial, they write that I need to create a High Resolution Application Icon:
32-bit PNG with an alpha channel
512 x 512 pixels
Maximum size of 1024KB

Should I use the same graphic for High Resolution Application Icon and Launcher Icons?
Where should I add the High Resolution Application Icon? Is it only used in my Google Play Console account for my application or is it necessary to add it to my Android project in Visual Studio for Mac?

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. JarvanZhang 23,971 Reputation points
    2021-11-19T05:38:10.733+00:00

    Hello @Kim Strasser ,​

    Welcome to our Microsoft Q&A platform!

    Android provoides alternate resources that target a specific device or run-time configuration such as the current language, particular screen size, or pixel density. If Android can match a resource that is more specific for a particular device or configuration than the default resource, then that resource will be used instead.

    Try add the following folders to place the icon with different sizes.

    • mipmap-hdpi
    • mipmap-mdpi
    • mipmap-xhdpi
    • mipmap-xxhdpi
    • mipmap-xxxhdpi

    Here is the related doc, you could refer to it:
    https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/resources-in-android/alternate-resources?tabs=macos

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.