Alan2
Alan2

Reputation: 24572

What size image is needed for the Application Image for an Xamarin.Forms application and how and where should I add this?

I am creating an application that I would like to run on Android and iOS devices with different screen sizes.

What size image do I need to use and where should I put this so that it shows as a thumbnail when the application is installed on the device before the application starts to run? In other words the image that a user clicks to start the application.

Also how can I get the best quality image. Should I use a png, jpg or is there another type of image that could be used? Any hints on creating this image would be much appreciated.

Upvotes: 0

Views: 2517

Answers (1)

FabriBertani
FabriBertani

Reputation: 1636

What you want is called App Icon, there are a lot of questions about this on SO and Xamarin docs.

iOS

Open Assets.xcassets under iOS project

enter image description here

If there isn't and AppIcon image set created, right click some empty place on the left white area and create a new AppIcon set, then click the AppIcon and just drag and drop the differents images size (you can see all the sizes the app need)

enter image description here

Finally open the Info.plist file and choose AppIcon as Source for App Icons

enter image description here

That should be enough for iOS App Icon, you can check this for more info: Application Icons in Xamarin.iOS

Android

For Android you would need to create icons with different sizes:

hdpi=281*164
mdpi=188*110
xhdpi=375*219
xxhdpi=563*329
xxxhdpi=750*438

48 × 48 (mdpi)
72 × 72 (hdpi)
96 × 96 (xhdpi)
144 × 144 (xxhdpi)
192 × 192 (xxxhdpi)
512 × 512 (Google Play store)

Then check if under Resources folder on the Android project are some folders named mipmap-(size), if not create like below:

enter image description here

Then place the icons in the corresponding folder with their size. Next you want to do is set the icon on the Android Manifest, so right click on the Android project and open Properties, then on Android Manifest tab (VS for Windows) or Android Application (VS for Mac) choose your icon, so it should look like @mipmap/MyIcon and on your Main Launcher Activity set the icon like Icon = "@mipmap/MyIcon".

All images should be png type.

Upvotes: 4

Related Questions