mark-mush / ExampleAndroidJobs

Job Scheduler Examples for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example Android Jobs

Job scheduler examples for android

This repository demonstrates several approaches for implementing peridic jobs in Android.

Each example is in its own branch:

Review diffs between each branch:

Android JobScheduler Firebase JobDispatcher Evernote Android-Job
Firebase JobDispatcher diff
Evernote Android-Job diff diff
Android AlarmManager diff diff diff

Table of Contents

Install

Download the source code and checkout the branch you want to use.

Open the project in Android Studio, compile and run the example (^R).

Usage

Press Schedule Job to begin the periodic notifications.

Notificaitons will occur approximately every 15 minutes.

You can disable notifications at any time by pressing the button again.

Implementation Notes

  • 15 minutes may seem like a long time for debugging purposes. You can try chaging the interval in SchedulerUtils.java. Results may vary depending on the platform version and scheduler implementation.

  • Firebase JobScheduler does not persist jobs through application killing or reboots. Rescheduling the job on android.intent.action.BOOT_COMPLETED may help address this problem. According to this issue it might be part of the intended library functionality.

  • Android AlarmManager example does not persist the job through application killing. Not sure how to go about fixing it without introducing JobScheduler to reschedule an alarm. Ley me know if you know a better way.

License

MIT © 2018 Mikhail Pontus

About

Job Scheduler Examples for Android


Languages

Language:Java 100.0%