Okay, time for some form of hibernation. Tomorrow will be a long day, I am all alone with the kids while my wife is on a cruise.
In other words, the original problem was a programming mistake. I could blame the junior developer for introducing that bug in the small refactoring she made, but because I did review that change the blame is all on me (as it should). Even the best of us (as if I would be even be in that group) make mistakes every now and then.
Sigh… The problem with those AsyncTasks was caused by a bug elsewhere™. I had added a lock mechanism for the database access (multithreading, yay!) and the lock was not released in one crucial network call that updates the data oftentimes. Now it is fixed and all those AsyncTasks work just fine.
But, as I was debugging this I decided I should refactor a couple of the bigger tasks to be based on IntentService instead. That then prompted me to refactor one continuously running service to be based on the plain Service instead. There can be only one IntentService running at any given time. Once the previous one completes, the next one will be started. And if that continuously run service would be based on IntentService, that would effectively block all other IntentService work, making all that other work pointless.
@jws Well, I tend to disagree. While RxJava is cool, I find the simplicity of AsyncTasks just great for simple tasks. For more complex things, of course, there are better alternatives. The thread jumping is pretty straightforward once you understand in which thread which methods are executed (onPreExecute and onPostExecute on the main thread, doInBackground in, well, a background thread). You just need to pay attention to where you update the UI.
// @matigo
@tewha Pnut seem to have a bunch Japanese and German active users, I have observed. But then again, I'm not there that often (maybe once a month), and I have barely any time to pop in here either.
// @larand
@larand Same here. When I started using Twatter more earlier that year I had high hopes. But that summer, when they announced the first big change and people got angry, I jumped to the ADN bandwagon and never looked back. I still have an account there, mostly for claiming my user name, but I don't post there on purpose1.
Except occasionally when we need to post some work related stuff to social media to show that we actually do some work for a thing we got for free from work.
@larand I think the writing has been on the wall since… (when was ADN launched, oh yeah, the same year as our youngest was born!) 2012. The 3rd-party apps seem to have gotten less and less access to the users' timelines since then every time Twatter has updated their APIs.
@matigo Something like that. AsyncTasks are pretty darn useful and easy to write, but because of some funky thread pooling change the solution I wrote for Android 6 totally broke on Android 7. These past few days I have been seriously considered becoming an alcoholic.
Damn you Android and your weird constraints. Apparently the thread pooling got changed in Android 7 and all the AsyncTasks do not get executed. One can convert those to IntentServices, which would run in the background just fine. However, there can be only one IntentService running, so using one for a background task that continuously listens to some changes blocks the execution of any new IntentServices. Then there's the generic Service, but that requires some manual house keeping to keep its state in order. Grr…