在Android API< 21中使用Job Scheduler [英] Using Job Scheduler in Android API <21

查看:79
本文介绍了在Android API< 21中使用Job Scheduler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看 Vogella 的调度教程.它提到了Android API 21中引入的 Job Scheduler API.我的问题是,它可以在低于21(棒棒糖)但不低于Android 3(蜂窝版)的API中实现吗?

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 in APIs lower than 21 (Lollipop) but not less than Android version 3 (Honeycomb)?

推荐答案

,您还可以使用新的GcmNetworkManager.此处介绍了如何使用它以及如何工作- https://developers.google.com/cloud-messaging/网络经理

from now on (after I/O 2015), you can also use new GcmNetworkManager. How to use it and how it works is described here - https://developers.google.com/cloud-messaging/network-manager

它做很多很酷的事情,例如通过重新启动使您的任务持续存在.在Lolipop上,它使用JobScheduler;在Lolipop上,它使用自己的实现.

It does a lot cool stuff like it persists your tasks trough reboots. On Lolipop it uses JobScheduler, on pre-Lolipop it uses it's own implementation.

有关如何使用它的示例代码: https://github.com/jacktech24/gcmnetworkmanager-android-example

An example code on how to use it : https://github.com/jacktech24/gcmnetworkmanager-android-example

这篇关于在Android API< 21中使用Job Scheduler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆