I have been using android-priority-job-queue V2 for 2 years now (great library). Android Workmanager just appeared. What I like about it is that it is really easy to setup and you don't have to fight with the JobScheduler, Firebase JobDispatcher, or AlarmManager, it is done for us. With android-priority-job-queue V2 I had to manually setup the FrameworkJobSchedulerService/GcmJobSchedulerService.
Is it possible with the Workmanagerto add a certain http url as a constraint? Sometimes, there are some data that you want to send to a server that is in a protected wifi and you are far from the geographic area. You take a picture (for example) that you have to save on that server later, when you are in the geographic area of the server and your device connects to the wifi. A url constraint will ensure that if the url is not reachable, the work request is never executed nor flushed (set as Failure). When the url constraint is met in agreement with connectivity, the work request is executed.
With android-priority-job-queue V2, I had to implement a logic that checked when android-priority-job-queue V2's shouldReRunOnThrowable(Throwable throwable, int runCount,int maxRunCount) threw a http exception and save the unsent data with Room Persistence Library. Then later, every time I detect a connectivity change status via the BroadCastReceiver, I try to resend the not sent data and flag those who where definitively sent (those who finished the onRun() in android-priority-job-queue V2). Later I would just flush every sent data from the data base via a periodic routine. This solution works. But let's say I want to send a different sort of data (picture, location, etc.), I have to rewrite the same routine for every different type of Job.
I don't see how to do the same with the WorkManager.
Can someone help me, by pointing me the part of the documentation I might have missed if this feature is implemented? Or at least a way to implement it with the WorkManager.
P.S: WhisperSystems' JobManager, allowed me to add a custom url. Yet the problem was that its persistance didn't worked on some devices (some Samsung models). When I crashed the app, data were never recovered. I went on github for help, to no avail. I am not accusing anyone of anything I am just trying to show that I have been looking for a solution for this.