11)[사이드 프로젝트]App개발_App Icon 및 Push Icon 만들기
* 앱을 만들더라도 출시를 위해서는 아이콘이 필수이기 때문에 만드는 방법을 정리하였다.
1) 사용툴
https://romannurik.github.io/AndroidAssetStudio/
Android Asset Studio
Launcher icon generator Generate launcher and store listing icons for your app.
romannurik.github.io
위의 사이트에서 사용해 본 기능 아래의 Launcher icon 과 Notification icon이다.
2) 사용방법
* 환경설정 ( 앱 아이콘 : ic_launcher.png / Notification : ic_notification.png )
// android\app\src\main\AndroidManifest.xml 파일내에
// 여기에 android:icon="@mipmap/ic_launcher" 이 앱아이콘에 해당하며 이건 기본으로 있음
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
// Push Notification에 적용되는 ic_notification은 아래 값을 <application> 태그 내에 넣어야한다.
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/ic_notification" />
1) 앱아이콘 ( 기본파일명 : ic_launcher.png )
-> 위의 asset studio에 들어가서 앱아이콘을 만들면 아래와 같이 각각의 해상도에 맞는 앱아이콘들이 나오게 된다.
-> 위의 각 파일을 기존에 존재하는 파일 android\app\src\main\res 내부에 있는 동일한 이름의 폴더에 붙여넣기를 한다.
다시 npm start / npm run android를 실행하면 아이콘이 적용된다.
2) 앱아이콘 ( 기본파일명 : ic_launcher.png )
-> 위의 Notification에 들어가서 이미지를 작성하면 아래와 같이 파일들이 나온다. 여기서 헷갈리지 말아야 되는 것은
나오는 파일이 drawable이라고 해서 drawable에 저장하면 안되고, 똑같이 mipmap의 폴더에 넣어 주어야 하고 파일이름은 ic_notification.png로 바꿔주어서 넣어줘야 한다.
최종적으로 아래와 같이 각 해상도의 mipmap 폴더 내에 ic_launcher.png 와 ic_notification.png 가 있으면 적용이 된다.