Extra Params for Network quality
setup params like requireNetwork(Network.Quality.GOOD). Imagine that you are trying to upload an image as external job and you receive because of bad network multiple timeouts even with retry strategy this will keep failing, so it will super nice if we have also a param which will setup the quality of the network.
Seems like a "one off" feature request because most apps don't have a way to measure this. How are you measuring the quality ? How do you understand it recovers?
Mobile networks are fragile by design so it would be better to rely on back-off instead of an additional property.
It's not a "one-off", you are right that they are fragile but what you can easily do is to check the type of the network. if you based on ConnectivityManager.TYPE_MOBILE then we can decide for example the type. Not sure if this based on the type of the antenna but I think it's based on how the symbol icon is shown in a device 4g, 3g, 2g, gprs which means the speed of the network.
about back-off this is what we have right now but imagine that you are in a place where the network is really bad by default.
Actually, there are many times where you can get better speed from a 3g network then a 4g network due to congestion etc. so that information is not super solid (but helpful).
You can still provide your custom NetworkUtil but all you'll get is 3 levels. (UNMEASURED, MEASURED, DISCONNECTED). This might be enough.
For the future, I have some plans to allow custom constraints on jobs so once I have it, this might be implemented on top of it but I don't think it is prominent enough to become part of the API.
So @yigit what you suggest about the case when a job starts Run and suddenly the network is down but you haven't an indicator of an exception in your task you are executing in the Job. Job is going to finish successfully but the task is not done. How can I mark my Job as not done based on the status of the task which I am executing there?
@spirosoik did you find a solution?