Giter VIP home page Giter VIP logo

sample-workmanager-images's Introduction

sample-workmanager-images

The app was built following Google Developers Codelabs. The app blurs photos and images and saves the result to a file with use of WorkManager concepts. The app demonstrates following features:

  • Scheduling a OneOffWorkRequest

  • Input and Output parameters

  • Chaining work together WorkRequests

  • Naming Unique WorkRequest chains

  • Tagging WorkRequests

  • Displaying WorkInfo in the UI

  • Cancelling WorkRequests

  • Adding constraints to a WorkRequest

  • Custom configuration

  • Publishing progress from Worker

  • Test Workers

  • View Binding to interact with views in place of findViewById.

CheatSheet

What is the WorkManager:

  • It is a backwards compatible, flexible and simple library for deferrable background work.

  • It is the recommended task scheduler on Android for deferrable work, with a guarantee to be executed.

  • It is part of Android Jetpack and an Architecture Component for background work that needs a combination of opportunistic and guaranteed execution.Opportunistic execution means that WorkManager will do the background work as soon as it can. Guaranteed execution means that WorkManager will take care of the logic to start your work under a variety of situations, even if you navigate away from your app.

  • WorkManager sits on top of a few APIs such as JobScheduler and AlarmManager. WorkManager picks the right APIs to use, based on conditions like the user's device API level.

WorkManager benefits:

  • Support for both asynchronous one-off and periodic tasks

  • Support for constraints such as network conditions, storage space, and charging status

  • Chaining of complex work requests, including running work in parallel

  • Output from one work request used as input for the next

  • Handles API level compatibility back to API level 14

  • Works with or without Google Play services

  • Follows system health best practices

  • LiveData support to easily display work request state in UI

When to use WorkManager:

  • The WorkManager library is a good choice for tasks that are useful to complete, even if the user navigates away from the particular screen or your app.

  • Some examples of tasks that are a good use of WorkManager:
    a) Uploading logs
    b) Applying filters to images and saving the image
    c) Periodically syncing local data with the network

Licence

Copyright 2020 Google LLC.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.