network i/o involves, among others, the possibility of delay in transmission. in other words, a situation over which
you have no control. such delays are anathema to android and may cause the so-called ANR failure because the
main thread (your app) is frozen waiting for the operation to finish. as a result, network i/o runs on a separate thread.
if it's successful, you get a result when one is available. if it fails, its failure is independent of the app's running (unless
you make assumptions in your app regarding the success of the operation, ie, assuming it was successful when it wasn't).
this allows your app to do other things, if applicable, until the network call has finished. now, i realize it may not be
your intention to do any other things while you wait for a result, but that's not the way android sees things.
network libraries made available to us have their network i/o run on a separate thread. that's why libraries such as
okhttputils2 work. otherwise, they too would crash like your app. if you're going to carry out network i/o yourself,
you need to run those ops on a separate thread.
in real life many network routines can run on the main thread without incident. but out of an abundance of caution,
android does not permit it unless overridden. if you override android's default behavior, you run the risk of
failure, not only due to timing issues, but as a result of programming errors (network protocols are demanding and
must be followed strictly). it's one thing to write a bad application for personal use; it's another to expect google to
distribute such an app on play.
you don't show how you make your call to zacks, but if you were using okhttputils2 - as urged by
@DonManfred - you
wouldn't see the error you see now.