android_job_scheduler 0.0.1 copy "android_job_scheduler: ^0.0.1" to clipboard
android_job_scheduler: ^0.0.1 copied to clipboard

outdatedDart 1 only

A new flutter plugin project.

android_job_scheduler_example #

Schedule Jobs using Android's JobScheduler API. This is very much Work in progress. Much of this Plugin is based on the android_alarm_manager Plugin.

Getting Started #

Add the Dependency #

tbd

Declare the JobScheduler Service in AndroidManifest.xml #

In your project's android/app/src/main directory, open the AndroidManifest.xml and add the following to the <application /> block:

<service
    android:exported="true"
    android:permission="android.permission.BIND_JOB_SERVICE"
    android:name="io.gjg.androidjobscheduler.AndroidJobScheduler">

Usage #

import 'package:android_job_scheduler/android_job_scheduler.dart';
// This MUST be a top level Function or a Static Class Member. It may not be a Class Method
// or a Closure. Inside this method, you don't have access to anything assuming a running
// Application.
void iRunPeriodically() {
    print('This gets run periodically by the Android JobScheduler API. '
          'Even when the App is not running. '
          'The Timings are not guaranteed to be exact by the Android OS, though.');
}

void main() {
    ...
    bool jobIsInstalled =
        await AndroidJobScheduler.scheduleEvery(
            const Duration(seconds: 10), iRunPeriodically);
}

For help getting started with Flutter, view our online documentation.

2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on android_job_scheduler