Android law enforcement recorder, Android smart hard hat and other Android video terminal APP startu

2022-09-26 17:57 Duniot Factory
QR code

Application startup:

If you need to quickly access your own application after booting up, you can click Android Manifest Static registration of system startup broadcast in xml, and

In the onReceive method, we start the main activity of the application. Our system does not limit the startup behavior of the application. The reference method is as follows:






    <intent-filter android:priority="1000”>//Increase broadcast priority

        <!--.Receive the broadcast completed by startup-->

        <category android:name="android.intent.category.DEFAULT" />

        <action android:name="android.intent.action.BOOT_COMPLETED" />



private static final String ACTION_BOOT = "android.intent.action.BOOT_COMPLETED";


public void onReceive(Context context, Intent intent) {

    if (intent.getAction().equals(ACTION_BOOT)) { //What to do after startup

        Log.d("BootBroadcastReceiver", "BootBroadcastReceiver onReceive(), Do thing!");

        Intent playIntent = new Intent(context, MainActivity.class);





Tips:After the application is installed, it needs to be started manually once to realize automatic startup after the next boot.

| 应用案例