right picture resolution for image asset? - android

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.

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" />

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.

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.
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.

Related

Enlarge android app launch icon

I used the launcher icon generator link below to create my own launcher icon:
https://romannurik.github.io/AndroidAssetStudio/
Then I download the zip package. Unzip it into the right directory and overwrite all the drawable-*/ic_launcher.png correctly with my launcher images.
The problem is that the launcher icon is small compared to other icons on my phone. Look at the image on the far right below:
How do I enlarge it's dimensions in android studio ?
Just edit those Mipmaps and enlarge them a bit.
Use this website, upload any of your icon (for better results use the larger one), edit sizes of every icon like you could multiply every icon's width and height by 1.25 and put them.
For Example -
192x192 => 240x240 [xxxhdpi]
144x144 => 180x180 [xxhdpi]
96x96 => 120x120 [xhdpi]
72x72 => 90x90 [hdpi]
48x48 => 60x60 [mdpi]
Also, Don't change any option on the website, just upload the file,
Enter the dimensions
Click on resize
Then download them
. I used this way and it worked great. Also, you could use photoshop but by the time photoshop will open, your work will be done.
And Downvotes are because of something you could do by yourself or something you could find on google or something hard enough to answer. Don't panic, even I can't post questions because I've more downvotes than upvotes on my questions.Also, don't forget to name all the files ic_launcher.png and store them in respective mipmap folder.

Android 6 - Removing Icon's Grey Padding

My app's icon has been displaying fine on Android devices prior to 6.0. Now on 6.0 devices there's a thick dark grey padding around the icon (please see the lower left icon in screenshot). My icon image has a white background with rounded edges.
I've ensured my icons have the resolutions for xxhdpi (144x144) and xxxhdpi (192x192), and I've checked the APK files to see the icons properly placed in the corresponding res/drawable-xxxx folders.
I've also tried regenerating the icons using Android Studio and online Android icon makers, as well as placing them in drawable / mipmap folders, but the same problem persisted.
How do I allow the icon to expand to the full size without the dark grey padding?
Thank you.
Easily you can use android studio Image Asset
click on app folder.
File => new => Image asset => select icon type as launcher icons => you can select image and browse => adjust
padding,and color => next => finish.
First : make sure that you icons are sliced probably without any padding.
Second : use mipmap folders for app launcher icons and make sure icons for all sizes.
Third : uninstall you application, clean & build and install fresh one.
hope this can help
That can be disabled by:
Go to Settings > Display > Icon backgrounds
Select Icons only

Which .png file do I have to replace for changing Icon symbol in Android Studios

When you code on Android Studio there is a standard icon symbol ( green Android ). I know how to change it. When I go to manifests.xml and look at this line
android:icon="#mipmap/ic_launcher"
the icon launcher must be in the directory "mipmap". When I go to mipmap, there are several .png files of ic_launcher.
Such as
ic_launcher.png(hdpi)
ic_launcher.png(mdpi)
ic_launcher.png(xhdpi)
ic_launcher.png(xxhdpi)
ic_launcher.png(xxxhdpi)
The question now is which of these files do I have to replace in order to get a new custom icon? Thank you.
You should use the Image Asset wizard. This allows you to add an Image Launcher which is the kind of image for your App's logo
Image Asset Pop-up Menu
Image Asset will ensure all resolutions and sizes for the logo.
They are categorized according to the size of screen for example tablet users uses xxhdi ic_launcher.png and hdpi ic_launcher.png for small size screen like 3 inches screen. If you are developing cool apps then you need to resize your icons for all these mentions size otherwise you can make any size and call them in manifest.
All of them because each one of them means that the icon will be displayed on the device depending on the size of the screen that is "from the smallest to the largest".
A tip if you are going to use the same icon for each one, first create the bigger image and then reduce it, I think the same android studio is reduced when you use the option because of the icon I think you can call application icon.
The biggest image is 512, this is the image of the web that will be displayed in the Play Store

Icon size in preference screen for Amazon Kindle Fire HD?

I've got Android application running on Amazon Kindle Fire HD 8.9". It's got a full HD display with carousel home screen where icons are 675x675 px big.
First problem I had was using standard small app icons which are stretched and blurry on this device. I solved it by adding new folder
drawable-large-mdpi
into /res folder and adding 675x675 icon in here.
This works and app icon in carousel is nice, big and sharp.
Second problem is that this big icon appears also in the SettingsActivity which is based on PreferenceActivity (PreferenceScreen and PreferenceCategory used in layout xml).
So, my question is how to use different (small one) icon here?
I tried
android:icon
but that doesn't work. Anybody knows?
If you are sideloading/testing your .apk then it will only use the default small icon. If you deliver the app through the appstore then it will use the assets you specify in the developer portal for the launcher carousel
https://developer.amazon.com/post/Tx18I929G17TAAS/Submitting-Visual-Marketing-Assets-Marketing-Tip-of-the-Day-4.html

Set icon for Android application

How can I set an icon for my Android application?
If you intend on your application being available on a large range of devices, you should place your application icon into the different res/drawable... folders provided. In each of these folders, you should include a 48dp sized icon:
drawable-ldpi (120 dpi, Low density screen) - 36px x 36px
drawable-mdpi (160 dpi, Medium density screen) - 48px x 48px
drawable-hdpi (240 dpi, High density screen) - 72px x 72px
drawable-xhdpi (320 dpi, Extra-high density screen) - 96px x 96px
drawable-xxhdpi (480 dpi, Extra-extra-high density screen) - 144px x 144px
drawable-xxxhdpi (640 dpi, Extra-extra-extra-high density screen) - 192px x 192px
You may then define the icon in your AndroidManifest.xml file as such:
<application android:icon="#drawable/icon_name" android:label="#string/app_name" >
....
</application>
Add an application launcher icon with automatic sizing.
(Android studio)
Go to menu File* → New → Image Assets → select launcher icon → choose image file.
It will automatically re-size.
Done!
I found this tool the most useful.
Upload an image.
Download a zip.
Extract it into your project.
Done
https://romannurik.github.io/AndroidAssetStudio/
It's better to do this through Android Studio rather than the file browser as it updates all icon files with the correct resolution for each.
To do so go to menu File → New → Image Asset. This will open a new dialogue and then make sure Launcher Icons is selected (Which it is by default) and then browse to the directory of your icon (it doesn't have to be in the project resources) and then once selected make sure other settings are to your liking and hit done.
Now all resolutions are saved into their respective folders, and you don't have to worry about copying it yourself or using tools, etc.
Don't forget "Shape - none" for a transparent background.
Please don't edit my answer without asking.
Put your images in mipmap folder and set in manifest file...
like as
<application android:icon="#mipmap/icon" android:label="#string/app_name" >
....
</application>
App Folder Directory :
Icon Size & Format :
Place your images in drawables folder under either of the three and set it like this.
Code
<application android:icon="#drawable/your_icon" >
....
</application>
Right click your project, go to New > Other > Android > Android Icon Set
Then follow the instructions on the Wizard
1-Create Your icon in Photoshop Or Coreldraw by size 256*256
note that use PNG file format if you want to have a transparent icon
2-Upload Your icon in https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
3-Set your setting on this site
4-Download the zip file automatically created by the webpage by clicking on download button
5-Extract the zip file and copy res folder to you project library
note that res folder contain all size icon
6-finally you need to set the manifest to use icon
<application android:icon="#drawable/your_icon" >
....
</application>
You can simply install an Android studio Martial icons plugin its name is please check plugin URL Material Design Icon Generator and check this GIF for more details:
This is mainly for creating the icons with required sizes, and it will be located directly in its folders.
I found all these answers that used to be solid answers to be a bit dated now. I reckon this will be the fate of this answer someday.
Click on your main project, most people would have "app" as their main project name by default. I like to be specific since I have other projects as well.
[your project name|app]->"New"->"Image Asset"
Then you will get to pick an image. I chose once that wasn't the greatest fit. Notice the tool shows you the "safe zone".
You can sample the different resolutions. Change the name, etc. The default name is "ic_launcher". I prefer to be expressive with the name so there is no confusion later which ic_launcher this belongs too.
Choose "Next", make changes if you need to, and ultimately "Finish". I found the rest of the tool to be self explanatory. For more info I suggest reading the manual that describes all these settings in more detail: Android Studio Image Asset Tool Documentation
On "Finish" this will put the files into the respective folders under the expected "res" folder.
The next thing you have to do is have to tell the project that's the icon you want to use. Inside the AndroidManifest.xml do something like the following (using your own name you chose to use above.)
<application
android:icon="#mipmap/pooflingers_ic_launcher">
That's pretty much it, as of today anyway... I am using Android Studio v4.2.1 Let me know when these steps become out of date.
You have to follow steps like:
You will see your default icons ic_launcher.png like:
You have to change all the images which are in mipmap-xxxx folders.
First of you have to create your own logo or pick up image that you want to place as icon of launcher and upload here Android Asset Studio - Icon Generator - Launcher icons, You will get all the set of mipmap-xxxx and web_icon also from that link.
Now you have to copy all the folders which are in side of res folder,
Now go to Android Studio Project -> Right click on res folder -> Paste. It will prompt you like File 'ic_launcher.png' already exists in directory, You can press Overwrite all. It will paste/replace images in respective folder.
Now you can run and see your application icon with new image.
Happy Coding :) :)
Choose icon picture copy this pic
Paste it into your project's res/drawable folder
Open manifest file and set
Run program
If you have an SVG icon, you can use this script to generate your android icon set.
In AndroidManifest change these :
android:icon="#drawable/icon_name"
android:roundIcon="#drawable/icon_name"
Define the icon for android application
<application android:icon="drawable resource">
....
</application>
https://developer.android.com/guide/topics/manifest/application-element.html
If your app available across large range of devices
You should create separate icons for all generalized screen densities,
including low-, medium-, high-, and extra-high-density screens. This
ensures that your icons will display properly across the range of
devices on which your application can be installed...
Size & Format
Launcher icons should be 32-bit PNGs with an alpha channel for
transparency. The finished launcher icon dimensions corresponding to a
given generalized screen density are shown in the table below.
Place icon in mipmap or drawable folder
android:icon="#drawable/icon_name" or android:icon="#mipmap/icon_name"
developer.android.com/guide says,
This attribute must be set as a reference to a drawable resource
containing the image (for example "#drawable/icon").
about launcher icons android-developers.googleblog.com says,
It’s best practice to place your app icons in mipmap- folders (not the
drawable- folders) because they are used at resolutions different from
the device’s current density. For example, an xxxhdpi app icon can be
used on the launcher for an xxhdpi device.
Dianne Hackborn from Google (Android Framework) says,
If you are building different versions of your app for different
densities, you should know about the "mipmap" resource directory.
This is exactly like "drawable" resources, except it does not
participate in density stripping when creating the different apk
targets.
For launcher icons, the AndroidManifest.xml file must reference the mipmap/ location
<application android:name="ApplicationTitle"
android:label="#string/app_label"
android:icon="#mipmap/ic_launcher" >
Little bit more quoting this
You want to load an image for your device density and you are going to use it "as is", without changing its actual size. In this case you should work with drawables and Android will give you the best fitting image.
You want to load an image for your device density, but this image is going to be scaled up or down. For instance this is needed when you want to show a bigger launcher icon, or you have an animation, which increases image's size. In such cases, to ensure best image quality, you should put your image into mipmap folder. What Android will do is, it will try to pick up the image from a higher density bucket instead of scaling it up. This will increase sharpness (quality) of the image.
Fore more you can read mipmap vs drawable folders
Tools to easily generate assets
Android Asset Studio by romannurik.github
Android Asset Studio by jgilfelt.github
Image Asset Studio(from Android Studio)
Material Icon Generator.bitdroid.de
Android Material Design Icon Generator Plugin by github.com/konifar
A script to generate android assets from a SVG file
Read more : https://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html
A bit old, but for future use:
Open Android Studio -> app/src/main/res -> Right Click -> Image Asset
Goto File->new->ImageAsset.
From their you can create Image Assets for your icon.
After that we will get icon image in mipmap different formats like
hdpi,mdpi,xhdpi,xxhdpi,xxxhdpi.
Now goto AndroidManifest.xml
<application android:icon="#mipmap/your_Icon"> ....</application>

Categories

Resources