I think your code is "Stream Upload" ,not "Chunk upload".
Chunk uplod is uplaod some slice file:this way can help server Verify file integrity.when some one or more one slice file error,just reupload error slice.this way save network Verify file integrity.because android network resource is not unlimit,server network need pay many.
Especially for large files,it is can help long network connect to not timeout. and @user16930239 say some server limit max file upload,the way can upload huge file.
Stram upload is read some data while upload some data.this way can save memory.Especially for large files ,at android use huge memory,May cause program crashes.
Two ways can use together.
How do I know if chunked upload is better than "single block" upload?
in general,here two ways > common upload,but you can use common upload for small file,bacause small file upload is so quike.
How do I know whether the server supports chunked upload at all?
Common service surpport Stream upload,but some old server not.chunk upload is not standard surpport.it have more secure, you must read doc of server,chunk upload API common is standalone api.
How should I choose the chunk size?
I think need 5MB,it is quick and low memory usge.You can up or down by your project.
The server at hand seems to have a limit of 2^16 bytes for a single request, but that might be different from server to server, couldn't it?
yes,this is config by server.