How can I set an icon for my Android application?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Put your images in
mipmap
folder and set in manifest file... like asApp Folder Directory :
Icon Size & Format :
Place your images in drawables folder under either of the three and set it like this.
Code
You can start by reading the documentation.
Here is a link:
How to change the launcher logo of an app in Android Studio?
A bit old, but for future use:
It's simple.
Now simply 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.
Define the icon for android application
https://developer.android.com/guide/topics/manifest/application-element.html
If your app available across large range of devices
Size & Format
Place icon in mipmap or drawable folder
android:icon="@drawable/icon_name"
orandroid:icon="@mipmap/icon_name"
developer.android.com/guide says,
about launcher icons android-developers.googleblog.com says,
Dianne Hackborn from Google (Android Framework) says,
For launcher icons, the AndroidManifest.xml file must reference the mipmap/ location
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
Read more : https://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html