Programming

Android 애플리케이션의 아이콘 설정

procodes 2020. 2. 10. 22:29
반응형

Android 애플리케이션의 아이콘 설정


Android 애플리케이션의 아이콘을 어떻게 설정합니까?


응용 프로그램을 다양한 장치에서 사용할 수있게하려면 응용 프로그램 아이콘을 res/drawable...제공된 다른 폴더에 배치해야합니다. 이러한 각 폴더에는 48dp 크기의 아이콘이 포함되어야합니다.

  • drawable-ldpi (120 dpi로, 저밀도 화면) - 36 픽셀 X 36 픽셀
  • drawable-mdpi (160 dpi의 중간 밀도 화면) - 48px X 48px
  • drawable-hdpi (240 dpi로, 높은 밀도 화면) - 72px X 72px
  • drawable-xhdpi (320 dpi의 여분 고밀도 화면) - 96px X 96px
  • drawable-xxhdpi (480 dpi로, 엑스트라 여분 고밀도 화면) - 144px X 144px
  • drawable-xxxhdpi (640 dpi로, 엑스트라 여분 여분 고밀도 화면) - 192px X 192px

그런 다음 AndroidManifest.xml파일 에서 아이콘을 다음과 같이 정의 할 수 있습니다 .

<application android:icon="@drawable/icon_name" android:label="@string/app_name" >
.... 
</application> 

이 도구가 가장 유용하다는 것을 알았습니다 .

  1. 이미지를 업로드하십시오.
  2. 지퍼를 다운로드하십시오.
  3. 프로젝트로 추출하십시오.

끝난

http://romannurik.github.io/AndroidAssetStudio/


자동 크기 조정이 포함 된 응용 프로그램 시작 관리자 아이콘을 추가하십시오.

(안드로이드 스튜디오)

메뉴 파일 * → 새로 만들기이미지 자산 → 실행기 아이콘 선택 → 이미지 파일 선택으로 이동하십시오.

자동으로 크기가 조정됩니다.

끝난!


간단 해.

이제 FileNewImage Asset 메뉴로 이동하십시오 . 새 대화 상자가 열리고 시작 관리자 아이콘이 선택되어 있는지 확인한 다음 (기본적으로 선택되어 있음) 아이콘 디렉토리 (프로젝트 리소스에있을 필요는 없음)를 찾은 다음 다른 항목이 선택되어 있는지 확인하십시오. 원하는대로 설정하고 완료했습니다.

이제 모든 해상도가 해당 폴더에 저장되므로 직접 복사하거나 도구 등을 사용할 필요가 없습니다.

여기에 이미지 설명을 입력하십시오

투명한 배경을위한 "모양-없음"을 잊지 마십시오.


이미지를 mipmap폴더에 넣고 매니페스트 파일에 설정하십시오 ...

 <application android:icon="@mipmap/icon" android:label="@string/app_name" >
 .... 
 </application>  

앱 폴더 디렉토리 :

여기에 이미지 설명을 입력하십시오

아이콘 크기 및 형식 : 여기에 이미지 설명을 입력하십시오


이미지를 3 개 중 하나의 드로어 블 폴더에 배치하고 이와 같이 설정하십시오.

암호

<application android:icon="@drawable/your_icon" >
.... 
</application>  

프로젝트를 마우스 오른쪽 단추로 클릭하고 새로 작성> 기타> Android> Android 아이콘 세트로 이동하십시오.

그런 다음 마법사의 지시를 따르십시오


1-256 또는 256 크기의 Photoshop 또는 Coreldraw에서 아이콘 만들기

투명한 아이콘을 원하면 PNG 파일 형식을 사용하십시오.

https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html 에서 2-Upload 아이콘

이 사이트에서 설정을 3 여기에 이미지 설명을 입력하십시오

다운로드 버튼을 클릭하여 웹 페이지에서 자동으로 생성 된 zip 파일을 4 회 다운로드하십시오 여기에 이미지 설명을 입력하십시오

5 zip 파일을 추출하고 res 폴더를 프로젝트 라이브러리에 복사하십시오. 여기에 이미지 설명을 입력하십시오

res 폴더에는 모든 크기 아이콘이 포함되어 있습니다.

6- 마지막으로 아이콘을 사용하도록 매니페스트를 설정해야합니다.

<application android:icon="@drawable/your_icon" >
.... 
</application>

Android Studio Martial 아이콘 플러그인을 간단히 설치할 수 있습니다. 플러그인 URL Material Design Icon Generator 를 확인하고 자세한 내용은이 GIF를 확인하십시오.

안드로이드 스튜디오 아이콘 플러그인

이것은 주로 필요한 크기의 아이콘을 생성하기위한 것이며 폴더에 직접 위치합니다.


설명서를 읽고 시작할 수 있습니다.

여기 링크가 있습니다 :

Android Studio에서 앱의 실행기 로고를 변경하는 방법은 무엇입니까?


  1. 아이콘 사진 선택이 사진 복사
  2. 프로젝트 res/drawable폴더에 붙여 넣기
  3. 매니페스트 파일을 열고 설정

  4. 프로그램 실행


다음과 같은 단계를 따라야합니다.

  • 다음 ic_launcher.png과 같은 기본 아이콘이 표시됩니다 .

여기에 이미지 설명을 입력하십시오

  • 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 :) :)


If you have an SVG icon, you can use this script to generate your android icon set.


A bit old, but for future use:

Open Android Studio -> app/src/main/res -> Right Click -> Image Asset

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

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

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

  1. Android Asset Studio by romannurik.github
  2. Android Asset Studio by jgilfelt.github
  3. Image Asset Studio(from Android Studio)
  4. Material Icon Generator.bitdroid.de
  5. github.com/konifar의 Android 머티리얼 디자인 아이콘 생성기 플러그인
  6. SVG 파일에서 안드로이드 자산을 생성하는 스크립트

더 읽기 : https://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html


File-> new-> ImageAsset으로 이동하십시오.

그들의 아이콘에서 이미지 자산을 만들 수 있습니다.

그런 다음 hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi와 같은 밉맵 다른 형식의 아이콘 이미지를 얻습니다 .

이제 AndroidManifest.xml로 이동하십시오.

<application android:icon="@mipmap/your_Icon"> ....</application>

참고 URL : https://stackoverflow.com/questions/5350624/set-icon-for-android-application



반응형