본문 바로가기
Android

[Android] 단말기 부팅 시 앱 자동 실행 (단말기 전원 껐다 켰을 때 앱 자동 실행)

by jjinthe 2024. 3. 13.
728x90

단말기 부팅 완료 후 앱 자동 실행을 하기 위해서는 몇가지 셋팅 해야 할 것이 있다. 

 

 

- manifest  셋팅  ( app -> manifests -> AndroidManifest.xml 선택)

 

 

- 퍼미션 등록

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

 

- 리시버 생성 (단말기 부팅 완료시 수행해야 할 거)

BootReceiver 이름으로 java class 생성 

 

 

 

 

- 생성한 리시버 manifest 에 등록

<application

...

 

        <receiver android:name=".리시버 이름">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>

<activity

/>

---

/>

 

 

 

 

끝 

 

 

 

 

 

728x90
반응형