-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shivaprasad Bhat
committed
Jun 14, 2021
1 parent
f47a5d4
commit 3cefe9f
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Android Work Manager - Notify | ||
|
||
## About the app | ||
|
||
> This application is developed to sending the notification periodically using android's WorkManager. Irrespective of the state (open / closed) the application sends a notification to the user. Every 16th minute, user will get a notification | ||
## Dependencies used in app | ||
|
||
- WorkManager | ||
- Timber (for logging) | ||
|
||
## Steps to Build the App | ||
|
||
- Clone the project from github | ||
- Open the project in Android Studio | ||
- Click the dropdown menu in the toolbar at the top (Open 'Edit Run/Debug configurations' dialog) | ||
- Select "Edit Configurations" | ||
- Click the "+" Button | ||
- Select "Gradle" | ||
- Choose your module as a Gradle project | ||
- In Tasks: enter assemble | ||
- Press Run | ||
|
||
Your debug apk will be generated at `<Project Name>/app/build/outputs/apk/debug/` | ||
|
||
## Setting Periodic Work Request | ||
|
||
```kotlin | ||
val worker = PeriodicWorkRequest.Builder(NotifyWorker::class.java, 15, TimeUnit.MINUTES) | ||
.build() | ||
|
||
WorkManager.getInstance(applicationContext).enqueue(worker) | ||
``` | ||
|