Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

JobSchedulerCompat

> 编程语言
Open source

[Deprecated] A backport of Android Lollipop's JobScheduler to api 10+

728 stars0 likes0 views
WebsiteGitHub

About

[Deprecated] A backport of Android Lollipop's JobScheduler to api 10+

JobSchedulerCompat

Warning this project is not maintained! Check out https://developers.google.com/cloud-messaging/network-manager for a possibly better solution. A backport of Android Lollipop's JobScheduler to api 10+.

All JobScheduler features are implemented. However, this library has not been well-tested, so I would advise not using in production at this time. There are no guarantees that this will not run down your battery or cause your device to explode.

Gradle

groovy
compile 'me.tatarka.support:jobscheduler:0.1.1'

Maven

xml

  me.tatarka.support
  jobscheduler
  0.1.1
  aar

You also have to enable manifest merging to ensure the services and receivers are added to your manifest.

xml

  com.jayway.maven.plugins.android.generation2
  android-maven-plugin
  
    true
  

Usage

The api is identical to the official JobScheduler, the only differences will be what you import.

First create a service to run your job.

…

Then use the JobScheduler to schedule the job.

…

Finally, register your JobService in the Manifest. Since on api

...

## Important caveats when running on api < 21

1. Pending jobs will be stored in `/system/job/jobs.xml`. Do not
   delete this file as it will causing jobs to not run.

2. If you use `setRequiresDeviceIdle(true)` then it may not immediately run in
   the first idle window. If your app is not running, it will no longer receive
   notifications on when the device is idle, therefore, it will awake every 91
   minutes to check. This is hopefully a reasonable compromise between
   preserving battery life and ensuring your job is run.

3. There may be other subtle differences on when and how many jobs run at the
   same time. This is because, unlike the system `JobScheduler`, the current
   implementatoin cannot detect the state of other jobs running on the system
   and batch them together.

## Contributing

The best way to help out right now is by testing, run it for a while and see if
it behaves like expected. Creating apps that would help log long-term usage
would be helpful as well.

If you want to do something more specific, feel free to leave a comment on any of
the unassigned issues, or create your own.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言