-->

让APP在安卓系统启动自动运行可以带来以下几个好处:
用户方便:当用户打开设备时,自动启动所需的APP可以让用户更方便地使用设备,不必手动打开APP。
提高用户黏性:自动启动APP可以让用户更快地开始使用APP,从而提高用户的黏性和留存率。
提高使用率:通过自动启动APP,可以提高用户对APP的使用率,从而为APP带来更多的流量和广告曝光机会。
提高用户满意度:自动启动所需的APP可以让用户更快地使用设备,并带来更好的用户体验,从而提高用户的满意度和忠诚度。
自动启动APP可以带来更好的用户体验和更高的用户黏性,从而为APP带来更多的价值和机会。
最近在做个电视看板业务,需要APP随着安卓系统启动后自动启动,不用人工操作,即可显示APP里面的数据信息,经查了资料后、测试、终于成功了......,
大概是过程,系统重启后,会给个广播,APP收到信息后,就在信息事件添加启动业务 APP源码下载。

第一步设置获取广播后的业务

package com.face.detail; import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent; public class BootCompleteReceiver extends BroadcastReceiver { @Override
public void onReceive(Context context, Intent intent) {
// TODO: This method is called when the BroadcastReceiver is receiving
// an Intent broadcast.
if(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())){
Intent thisIntent = new Intent(context, MainActivity.class);
thisIntent.setAction("android.intent.action.MAIN");
thisIntent.addCategory("android.intent.category.LAUNCHER");
thisIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(thisIntent);
}
}
}

第二查权限给APP


package="com.face.facefeature">




android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:installLocation="internalOnly"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
android:name=".detail.BootCompleteReceiver"
android:enabled="true"
android:exported="true">








  

理论以上两步做完就可以了。APP也能收到广播信息了, 但是APP没有在桌面启动。

经过再研究,发现要在手机再设置自动开启等业务,以下是小米、魅族的系统设置的一些内容,其它平台自己研究。

这里已经显示收到广播信息

 小米系统平台设置

  魅族平台设置,魅族的界面还是相当漂亮的

-->