Using Job Scheduler in Android API <21

后端 未结 7 1943
臣服心动
臣服心动 2020-12-13 06:27

I was looking at a scheduling tutorial by Vogella. It mentions the Job Scheduler API that was introduced in API 21 of Android. My question is can it be implemented i

7条回答
  •  执念已碎
    2020-12-13 06:38

    The recommended approach for pre-lollipop devices is to use the https://github.com/firebase/firebase-jobdispatcher-android#user-content-firebase-jobdispatcher-

    Read more on https://developer.android.com/topic/performance/scheduling.html#fjd

    Firebase JobDispatcher is an open-source library that provides an API similar to JobScheduler in the Android platform. Firebase JobDispatcher serves as a JobScheduler-compatibility layer for apps targeting versions of Android lower than 5.0 (API level 21).

    Firebase JobDispatcher supports the use of Google Play services as an implementation for dispatching (running) jobs, but the library also allows you to define and use other implementations: For example, you might decide to use JobScheduler or write your own, custom code. Because of this versatility, we recommend that you use this Firebase JobDispatcher if your app targets a version of Android lower than 5.0 (API level 21).

    For more information about Firebase JobDispatcher, refer to its documentation and source code.

提交回复
热议问题