aeric Expert Licensed User Longtime User Jul 22, 2025 #1 I understand that OkHttpUtils2 library has made downloading resources become very simple using Wait For. In 2023, HttpUtils2Service inside OkHttpUtils2 library has changed to a receiver. Is there anything changed that affecting how we download a (relatively huge) file in Android today? Is DownloadService still relevant on today to show download progress and CancelDowload? Erel said: If it is not huge then use the regular OkHttpUtils2 library and make the download from the starter service (for B4XPages projects this is not needed). Click to expand... Do I still need to modify OkHttputils2 library or I can just add a modified class to override the library?
I understand that OkHttpUtils2 library has made downloading resources become very simple using Wait For. In 2023, HttpUtils2Service inside OkHttpUtils2 library has changed to a receiver. Is there anything changed that affecting how we download a (relatively huge) file in Android today? Is DownloadService still relevant on today to show download progress and CancelDowload? Erel said: If it is not huge then use the regular OkHttpUtils2 library and make the download from the starter service (for B4XPages projects this is not needed). Click to expand... Do I still need to modify OkHttputils2 library or I can just add a modified class to override the library?
Solution Erel Jul 22, 2025 Implement the downloading task in the starter service. It shouldn't be difficult to do.
Erel B4X founder Staff member Licensed User Longtime User Jul 22, 2025 #2 You should use OkHttpUtils2 and you don't need to modify it. You don't need DownloadService. You should use B4XPages. The RangeDownloader is a good solution for large files: https://www.b4x.com/android/forum/threads/b4x-rangedownloader-resumable-downloads.133370/ The best way to cancel ongoing requests is with RequestsManager class. You can find it inside SimpleMediaManager.b4xlib. It is cross platform and works with OkHttpUtils2 / iHttpUtils2. Note that you need to add HU2_PUBLIC to the build configuration. Upvote 0
You should use OkHttpUtils2 and you don't need to modify it. You don't need DownloadService. You should use B4XPages. The RangeDownloader is a good solution for large files: https://www.b4x.com/android/forum/threads/b4x-rangedownloader-resumable-downloads.133370/ The best way to cancel ongoing requests is with RequestsManager class. You can find it inside SimpleMediaManager.b4xlib. It is cross platform and works with OkHttpUtils2 / iHttpUtils2. Note that you need to add HU2_PUBLIC to the build configuration.
aeric Expert Licensed User Longtime User Jul 22, 2025 #3 Erel said: You should use B4XPages. Click to expand... Unfortunately it is an old app developed more than 10 years ago. It is too tedious to port it to B4XPages. I am thinking to remove all the download parts entirely until users come back to me. Upvote 0
Erel said: You should use B4XPages. Click to expand... Unfortunately it is an old app developed more than 10 years ago. It is too tedious to port it to B4XPages. I am thinking to remove all the download parts entirely until users come back to me.
Erel B4X founder Staff member Licensed User Longtime User Jul 22, 2025 #4 Implement the downloading task in the starter service. It shouldn't be difficult to do. Upvote 0 Solution