Search
📘

15강. Application Class

무단 도용 및 복제, 사용 저작권 안내 수업 목적 외에 모든 교안 자료를 무단으로 도용 (URL 연결, 복제, 공유), 불법으로 복사하여 배포하는 것을 금지합니다. 꼭 지켜주세요!

1. Application Class

안드로이드 애플리케이션에 단 하나를 지정할 수 있는 객체이다.
이 객체는 같은 안드로이드 애플리케이션이라면 어디서든 주소 값을 가져올 수 있다.
이를 통해 안드로이드의 다양한 구성요소에서 공통적으로 사용하는 데이터를 관리할 수 있다.
Application Class는 Application을 상속받고 AndoridManifest.xml 에 등록하면 된다.
class AppClass : Application()
Kotlin
복사
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:name=".AppClass">
Kotlin
복사

2. 학습 정리

정리
Application Class를 사용하면 같은 애플리케이션 내에서 자유롭게 접근하여 공통 데이터를 관리할 수 있다.