-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
07-workmanager #14
Open
Serchinastico
wants to merge
1
commit into
06-navigation
Choose a base branch
from
07-workmanager
base: 06-navigation
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
07-workmanager #14
Conversation
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
Serchinastico
force-pushed
the
07-workmanager
branch
from
February 7, 2019 14:31
4e68384
to
98185c7
Compare
davideme
reviewed
Feb 11, 2019
app/src/androidTest/java/com/karumi/jetpack/superheroes/ui/view/FragmentTest.kt
Outdated
Show resolved
Hide resolved
davideme
reviewed
Feb 11, 2019
app/src/main/java/com/karumi/jetpack/superheroes/SuperHeroesApplication.kt
Show resolved
Hide resolved
davideme
reviewed
Feb 11, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job
Serchinastico
force-pushed
the
06-navigation
branch
from
March 7, 2019 14:43
d49192e
to
4e8e60e
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
March 7, 2019 14:44
98185c7
to
69cfbfb
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
March 7, 2019 14:56
4e8e60e
to
d4af8a6
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
March 7, 2019 14:56
69cfbfb
to
525139d
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
March 15, 2019 11:33
d4af8a6
to
4ab92d2
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
2 times, most recently
from
March 15, 2019 11:42
69c1fae
to
bda0424
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
March 15, 2019 16:40
4ab92d2
to
9fc98ea
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
March 15, 2019 16:40
bda0424
to
38ac427
Compare
Serchinastico
force-pushed
the
06-navigation
branch
2 times, most recently
from
March 15, 2019 17:35
f6c7309
to
c76a270
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
March 15, 2019 17:36
38ac427
to
f79dd86
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
March 15, 2019 17:46
c76a270
to
f1c5174
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
March 15, 2019 17:48
f79dd86
to
e23d742
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
March 15, 2019 18:44
f1c5174
to
3f74f1e
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
March 15, 2019 18:45
e23d742
to
a09ab8c
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
May 21, 2019 10:31
3f74f1e
to
1525d10
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
May 21, 2019 10:33
a09ab8c
to
50ab0f0
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
May 21, 2019 16:09
1525d10
to
6e92f13
Compare
Serchinastico
force-pushed
the
07-workmanager
branch
from
May 21, 2019 16:11
50ab0f0
to
eae099a
Compare
Serchinastico
force-pushed
the
06-navigation
branch
from
May 22, 2019 16:51
6e92f13
to
cc47dd6
Compare
Add tests
Serchinastico
force-pushed
the
07-workmanager
branch
from
May 22, 2019 16:55
eae099a
to
6d9ecdd
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is not meant to be merged
This is how to use the WorkManager component:
Worker
that is going to be executed in a background thread or an asynchronousListenableWorker
that runs in the UI thread and returns aListenableFuture
. We opted for a regularWorker
because we didn't have any asynchronous computation.PeriodicWorkRequest
on theApplication::onCreate
method that runs every 15 minutes (the minimum period for workers). It deletes half the super heroes from the list.02c-room-testing
and here I will be just moving it to a worker test to see how to write them. The hardest part was to get deterministic results. Workers were being executed a random number of times even though I'm enqueuing it only once. The solution is to enqueue the worker on the UI thread withgetInstrumentation().runOnMainSync
but I'm still unsure why this fixes anything 🤷♂️.