Giter Club home page Giter Club logo

zalalm's Introduction

ZAlalm 闹钟实例

1、杀不死的Service。

2、双进程保护Aidl。

3、Android 5.0 JobScheduler和Android 6.0 Doze模式。

4、AppWidget小组件。

5、对一些系统广播监听(开机、锁屏、安装更新APP...)。

/**

  • Android 闹钟实例:
  • 1、杀不死的服务Service,只能在进程存在的情况下,降低系统回收几率。
    • A:android:priority="1000"最高权限;
    • B:onStartCommand返回值设置,getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.ECLAIR ? START_STICKY_COMPATIBILITY : START_STICKY;
    • C:前置服务,startForeground(int id, Notification notification);
    • D:onDestroy()方法中重启服务。
  • 2、双进程保护:AIDL,开启两个Service(A和B),运行在两个不同的进程中android:process=":remote_service",实现A和B相互守护。
  • 3、Android 5.0 JobScheduler,Android 6.0 Doze模式。
  • 4、AppWidget小组件开发,定义倒计时小组件,在小组件中启动闹钟服务。
  • 5、对一些系统广播监听(开机、锁屏、安装更新APP...)
  • @author 邹峰立 */

zalalm's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.