right picture resolution for image asset?

958 Views Asked by At

I am a beginner in android programming and created a tic tac toe project for learning purposes. I used Android Studio as IDE. The game is finished now only the launcher icon is missing.

In order to create different sized launcher icons, I just go to res > New > Image Asset and point to my png-file. But when I use pictures like (1000x1000) or (800x800) it seems to be way too big and only the center of the picture is seen as a logo. So I wonder whats the right resolution for a picture to use in the Image Asset? And whats the typical way to create such a - right sized - logo?

The developer docs don't specify this and I couldn't find any useful information about that online.

3

There are 3 best solutions below

0
On BEST ANSWER

Go to Andorid Studio File -> New -> Image Asset

Choose Icon Type: Launcher Icons (Legacy Only)

enter your icon name as: ic_launcher

Asset Type: icon

Choose the Path of your Icon. (Choose icon with minimum size of 512x512)

There will be a slider to adjust the padding of the Launcher Icon. You can use it to adjust the image.

Add the background if you want. But you need to adjust the padding if you want to see this background color.

Choose your Scaling to crop.

Choose your shape: Square/Circle/Horizontal/Vertical/None

Effect: None

Now click the "Next" button. it will take you to a confirmation page. Click the "Finish" button. The old icons will be replaced with new icons.

Configure Image Asset

Done.

You can choose Icon Type: Launcher Icons(Adaptive and Legacy) if you want to create the best Launcher Icon. But as a beginner, I suggest you should start with Legacy Only ;D . Hope this will help you.

1
On

The Android ImageView has an attribute called ScaleType, this will allow you to scale your image. You can check out all the various type this link. link

Here is an example on how to do it:

 <ImageView
    android:scaleType="fitXY" />
0
On

If you already owned a Google Play Developer Console Account and you want to publish your apps on Google Play Store, Google Play Console will ask you to prepare the Graphic Asset including the launcher icon, screen shot, feature graphic, etc.

The requested launcher icon (shown on Google Play Store) must be 512 x 512 px. This is the requirement.

But ...

for your launcher icon on Android Studio, on Image Asset, you only need to adjust the padding button and activate trim. But remember, do not change the name of launcher icon. Stay with name ic_launcher. See this :

<img src="https://thumbs.gfycat.com/GlassScaryBluefintuna.webp"/>

After that, android studio will automatically scale your launcher icon into some size like ldpi, mdpi, hdpi, xhdpi, xxhdpi, and xxxhdpi. The android device will choose the launcher icon based on its device size.