1
2Android JobScheduler Sample (Kotlin)
3====================================
4
5Demonstration of the JobScheduler API, which provides an interface for scheduling
6background tasks when certain tasks apply.
7
8To understand how this sample works, try these different scenarios:
9
10- Unplug device, schedule a task that requires the device to be plugged in. Job will start when the
11device is plugged in.
12- Set a delay of 10 seconds and press back. The activity and service are finished but the service is
13launched again in 10 seconds (logcat will show debug messages).
14- Set a delay of 5 seconds and a work duration of 10 seconds. Schedule job and press the
15back button. Open the activity again after 6 seconds. The activity will show the onStopTask even
16though both activity and service were shut down.
17
18Pre-requisites
19--------------
20
21- Android SDK 27
22- Android Support Repository
23
24Getting Started
25---------------
26
27This sample uses the Gradle build system. To build this project, use the
28"gradlew build" command or use "Import Project" in Android Studio.
29
30Support
31-------
32
33- Google+ Community: https://plus.google.com/communities/105153134372062985968
34- Stack Overflow: http://stackoverflow.com/questions/tagged/android
35
36If you've found an error in this sample, please file an issue:
37https://github.com/googlesamples/android-JobScheduler
38
39Patches are encouraged, and may be submitted by forking this project and
40submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
41
42License
43-------
44
45Copyright 2017 The Android Open Source Project, Inc.
46
47Licensed to the Apache Software Foundation (ASF) under one or more contributor
48license agreements.  See the NOTICE file distributed with this work for
49additional information regarding copyright ownership.  The ASF licenses this
50file to you under the Apache License, Version 2.0 (the "License"); you may not
51use this file except in compliance with the License.  You may obtain a copy of
52the License at
53
54http://www.apache.org/licenses/LICENSE-2.0
55
56Unless required by applicable law or agreed to in writing, software
57distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
58WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
59License for the specific language governing permissions and limitations under
60the License.
61