第一种: 监控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>


更多相关文章

  1. 深入分析Android开机找网延迟
  2. Android(安卓)TextWatcher监控EditText中的输入内容并限制其输入
  3. Android中实现ScrollView的滚动事件监听
  4. Android(安卓)触摸事件的传递过程
  5. Android开发笔记(一百一十七)app省电方略
  6. Android开机动画 (boot animation)制作
  7. Android消息处理
  8. android简单实例--------普通菜单optionMenu,上下文菜单ContextMe
  9. Android开机动画之开机bootvideo与bootanimation.zip的选择

随机推荐

  1. Android中文API合集(7) + 开发者指南合集
  2. 分享一个好用的Android投屏工具-scrcpy
  3. 修改编译android文件系统编译链版本
  4. Android 仿滴滴首页嵌套滑动效果
  5. Android中VideoView及SurfaceView视频播
  6. Android基于腾讯X5内核的WebView(超级浏
  7. 用Kotlin实现Android点击事件的方法
  8. Android 中Seekbar详解及简单实例
  9. Android dpi,dp,dip,px的关系
  10. Android ORM系列之GreenDao最佳实践