# KeepLive **Repository Path**: wasdzy/KeepLive ## Basic Information - **Project Name**: KeepLive - **Description**: No description available - **Primary Language**: Android - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2018-11-29 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # KeepLive #### 项目介绍 项目保活程序,支持退入后台、锁屏,不支持结束进程!不支持结束进程!不支持结束进程!(重要的事情说三遍) #### 使用说明 ~~~ //A 本案例保活步骤: //1、配置权限 //2、配置Manifest中的Service //3、修改Contants中的包名 //4、修改引用MainActivity (SinglePixelActivity、AliveJobService) //5、动态注册广播 //6、在activity中启动 //7、添加mp3资源、配置style样式 //动态广播 只需要注册一次(建议写在一个 不易销毁的activity中) screenReceiverUtil = new ScreenReceiverUtil(this); screenReceiverUtil.register(); //每个Activity onCreate中 都写这句话 new InitSaveUtil(this).startSaveMethod(); //注销广播 @Override protected void onDestroy() { super.onDestroy(); if (null != screenReceiverUtil) { screenReceiverUtil.unRegister(); } } //B 、其他保活:开启电量优化、手动开启程序后台运行、电池白名单; ~~~