Android开机启动自动播放视频,应用于安卓机顶盒

牛大兵 2019-08-11 09:46:05
第一种: 监控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>


...全文
1273 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

80,358

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧