android start service on boot

Solutions on MaxInterview for android start service on boot by the best coders in the world

showing results for - "android start service on boot"
Inaya
12 Oct 2020
1<!-- Allows application to receive actions related to rebooting -->
2<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
3
4<!-- Inside your <application> -->
5<receiver
6	android:name="com.example.MyBroadcastReceiver"
7	android:exported="true"
8	android:enabled="true"
9    android:installLocation="internalOnly">
10	<intent-filter>
11		<!-- Handles cold reboot (power off/on) -->
12		<action android:name="android.intent.action.BOOT_COMPLETED" />
13		<!-- Handles quick restart -->
14		<action android:name="android.intent.action.QUICKBOOT_POWERON" />
15	</intent-filter>
16</receiver>
17