<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Quotes"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Quotes">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
이 AndroidManifest.xml 파일은 안드로이드 애플리케이션의 설정 정보를 담고 있어요.
각 태그의 의미를 하나씩 설명해 드릴게요! 🚀
📌 최상위 태그: <manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
✅ 앱의 기본적인 정보를 정의하는 최상위 태그
- xmlns:android="..." → Android 네임스페이스 선언 (안드로이드 속성을 사용할 수 있도록 지정)
- xmlns:tools="..." → Android Studio에서만 사용하는 속성 (개발 도구용 속성 설정)
📌 <application> (앱의 전반적인 설정)
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Quotes"
tools:targetApi="31">
✅ 앱의 전반적인 속성을 설정하는 태그
속성명 | 설명 |
android:allowBackup="true" | 앱 데이터를 백업 허용 (사용자가 새 기기로 옮길 때 데이터 복구 가능) |
android:dataExtractionRules="@xml/data_extraction_rules" | 백업 데이터의 처리 규칙을 정의하는 XML 파일 지정 |
android:fullBackupContent="@xml/backup_rules" | 어떤 데이터가 백업될지 정의하는 파일 지정 |
android:icon="@mipmap/ic_launcher" | 앱의 기본 아이콘 설정 (홈 화면에서 표시되는 아이콘) |
android:label="@string/app_name" | 앱의 이름 설정 (런처에서 표시되는 앱 이름) |
android:roundIcon="@mipmap/ic_launcher_round" | 둥근 아이콘 지정 (안드로이드 7.1 이상 적용) |
android:supportsRtl="true" | RTL(오른쪽 → 왼쪽) 언어 지원 여부 (아랍어, 히브리어 등) |
android:theme="@style/Theme.Quotes" | 앱의 기본 테마 지정 |
tools:targetApi="31" | 개발 도구에서 Android 12(API 31) 기준으로 빌드하도록 설정 |
📌 <activity> (앱의 주요 화면 설정)
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Quotes">
✅ 앱에서 실행될 액티비티(Activity)를 정의
속성명 | 설명 |
android:name=".MainActivity" | 이 액티비티의 클래스명 (MainActivity.java 또는 MainActivity.kt와 연결) |
android:exported="true" | 다른 앱에서도 이 액티비티를 실행할 수 있도록 허용 (Android 12 이상에서 intent-filter가 있을 경우 필수 설정) |
android:label="@string/app_name" | 이 액티비티의 이름 설정 |
android:theme="@style/Theme.Quotes" | 이 액티비티에서 사용할 테마 지정 |
📌 <intent-filter> (앱 실행 관련 설정)
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
✅ 이 액티비티가 앱을 실행할 때 어떤 역할을 할지 정의
태그 | 설명 |
<action android:name="android.intent.action.MAIN"/> | 앱의 진입점(메인 액티비티)으로 설정 |
<category android:name="android.intent.category.LAUNCHER"/> | 홈 화면에서 이 액티비티를 실행할 수 있도록 설정 |
📌 이 설정이 없으면 앱이 홈 화면에서 실행되지 않음!
📌 정리: AndroidManifest.xml 파일이 하는 역할
1️⃣ 앱의 기본적인 속성 설정 (백업, 아이콘, 테마 등)
2️⃣ 메인 액티비티(MainActivity)를 정의하여 앱이 실행될 때 진입점 설정
3️⃣ 홈 화면에서 앱을 실행할 수 있도록 인텐트 필터 추가
'computing' 카테고리의 다른 글
20250325_OS4 (1) | 2025.03.25 |
---|---|
20250324_DB3 (2) | 2025.03.24 |
AndroidStudio 알아보기 (0) | 2025.03.20 |
20250318_OS3 (0) | 2025.03.18 |
PCB(Process Control Block)의 기능, 특징 (2) | 2025.03.18 |