question

RonaldGANS-4488 avatar image
0 Votes"
RonaldGANS-4488 asked JamesMontemagno edited

How to change app's icon

This for an Android/Xamarin app. There are six mipmap folders in the Resources folder: anydpi-v26, hdpi, mdpi, xhdpi, xxhdpi and xxxhdpi. But how do I associate one of them with the app? The current icon is very low quality.

Thanks.
RON

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeonLu-MSFT avatar image
0 Votes"
LeonLu-MSFT answered LeonLu-MSFT edited

Hello,​

Welcome to our Microsoft Q&A platform!

First of all, please use this too(search Android Asset Studio Launcher icon generator) to upload your icon(need high quality), setting some details about your needs, then download the icon (click the top-right blue background arrow), you can get a zip, open the zip, you can find several folders.

121768-image.png

open these folders, copy the image to your Xamarin android folder like following screenshot(For example, I copy the image from mipmap-hdpi folder, then I put it in your mipmap-hdpi folder of xamarin.android project, mipmap-mdpi, mipmap-xhdpi, mipmap-xxhdpi, mipmap-xxxhdpi are executed same operation).

121893-image.png

Then, open the mipmap-anydpi-v26 folder , edit the icon.xml and icon_round.xml.

change the value of foreground to your icon name, my new icon name is launcher_foreground

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/launcher_background" />
    <foreground android:drawable="@mipmap/launcher_foreground" />
</adaptive-icon>


Best Regards,

Leon Lu



If the response is helpful, please click "Accept Answer" and upvote it.

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.


[1]: https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html#foreground.type=image&foreground.space.trim=1&foreground.space.pad=0&foreColor=rgba(96%2C%20125%2C%20139%2C%200)&backColor=rgb(33%2C%20150%2C%20243)&crop=1&backgroundShape=square&effects=none&name=ic_launcher


image.png (12.1 KiB)
image.png (21.8 KiB)
· 13
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi and thanks! I have to go to work shortly but I will try to follow your suggestions when I'm back, tonight.

Again thanks!!

RON

0 Votes 0 ·

Is that worked? If you met other issue, you can post your demo, I will help you to troubleshot this issue.

0 Votes 0 ·

I'll be able to try your suggestions on Thursday (was working the last few days).

RON

0 Votes 0 ·

Ok, waiting for you update.

0 Votes 0 ·

Well, new errors. Here's my icon.xml file from mipmap_anydpi26:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">;
<background android:drawable="@color/launcher_background"/>
<foreground android:drawable="@mipmap/launcher_foreground"/>
</adaptive-icon>

There is a launcher_background and launcher_foreground png files in mipmap-hdpi folder.


BUT now I get this error:

mipmap/myicon) not found.

0 Votes 0 ·

It's like what Roseanne roseannadanna saId: "If it's not one thing, it's something else."

0 Votes 0 ·

I am still confused. The app will not compile. What should my Resources look like? What should be in the manifest? This is all extremely confusing. I spend a year writing C# code only to stumble over some xml files.

0 Votes 0 ·
Show more comments
JamesMontemagno avatar image
0 Votes"
JamesMontemagno answered JamesMontemagno edited

Checkout my video on how to use Easy App Icon to generate everything for you -> https://www.youtube.com/watch?v=XEAyAf3_MpU


https://easyappicon.com/ makes your life so much easier, and if anything will give you a reference of the different files you will need to use.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.