From Newsgroup: comp.mobile.android
Jakub, 2026-06-01 15:00:
How to add progress bar to this fun to show procent loading?
[...]
val inputStream = httpsURLConnection.getInputStream()
ztimer++
Log.i("ppp", "ztimer -> " + ztimer)
zbitmap04 = BitmapFactory.decodeStream((inputStream))
Do not use BitmapFactory.decodeStream() but download the stream
"manually" and then decode the bitmap after downloading. However this
still leaves a problem unsolved: you don't know how many bytes will be
sent on the stream - but this information would be required to determine
the progress.
So in addition you need to analyse the HTTP response headers for the URL
to see if there is any Content-length field present.
--
Arno Welzel
https://arnowelzel.de
--- Synchronet 3.22a-Linux NewsLink 1.2