zoukankan      html  css  js  c++  java
  • android 开机自启动的几种方法,监听不到RECEIVE_BOOT_COMPLETED的处理办法

    第一种:  监控RECEIVE_BOOT_COMPLETED,即开机启动事件

    另外一种: 监控sd卡mount事件  开机总会扫描sd卡吧? 监控sd卡事件也有类似开机启动效果。特别app安装在sd卡的情况下有些os是抓取不到RECEIVE_BOOT_COMPLETED

    第三种: android:installLocation="internalOnly", 限制app的安装位置,使其能抓取到RECEIVE_BOOT_COMPLETED

    第四种: 监听电话或者短信事件。手机总得打电话收发短信吧? 万一实在不行。退而求其次。这样的方式还是可行的。


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

            <receiver android:name="com.example.receiver.SystemEventReceiver" 
                	  android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" /> 
                </intent-filter>
               <intent-filter>
                    <action android:name="RestartSerivcesForSystemEventReceiver" />   
                </intent-filter>
               <intent-filter>
    	        <action android:name="android.intent.action.MEDIA_MOUNTED" />
    	        <action android:name="android.intent.action.MEDIA_UNMOUNTED" />
    	        <action android:name="android.intent.action.MEDIA_EJECT" />
    	        <data android:scheme="file" >
            </data>  
                </intent-filter>
            </receiver>


  • 相关阅读:
    vim 命令替换重复命令
    Python环境安装
    MySQL 查看show profile
    XSS攻击与CSRF攻击与防御
    HTTPS的原理
    PHP curl的请求步骤
    【论文阅读】HRNet
    【学习笔记】gRPC-python
    【Linux学习笔记】Linux基础
    【Golang学习笔记】入门:结构体、方法与接口
  • 原文地址:https://www.cnblogs.com/yxysuanfa/p/6797190.html
Copyright © 2011-2022 走看看