kiwix-android
kiwix-android copied to clipboard
QQ: Do we include the Fetch downloader in the custom apps?
I noticed Fetch appears in the credits for the custom apps (if I've understood https://github.com/kiwix/kiwix-android/blob/19a70529f481909ff78ab7c879d9c85ceaeed304/custom/src/main/assets/credits.html correctly). I'd expect the Fetch library would only be used in the core Kiwix app and not be part of the custom apps. If it is, perhaps we could remove it?
You're welcome to close this issue if it's off-topic, or once the answer's clear.
@MohitMaliFtechiz Do we include dependences that we don’t use in custom apps?
hi @kelson42 and @julianharty ,
We are downloading TestZim file in custom by using Fetch Library that why its included on cusotm.
@MohitMaliFtechiz I think I understand... there should be a fallback system in custom apps which makes the app downloading the ZIM at first run if for any reason the packaged ZIM is not available... Could you please confirm?
FYI here's Google Android's documentation on implementing checks and a downloaded to obtain expansion files from Google Play if/when required https://developer.android.com/google/play/expansion-files?hl=en#Downloading
Iff (if and only if) we choose to add support to download expansion files from sources outside Google Play then this SO discussion is relevant https://stackoverflow.com/questions/56042793/manually-downloaded-android-obb-file-deleted-after-app-update-through-play-stor (the person who answered the question works for Google as a software developer for Google Play so is an expert on the topic https://stackoverflow.com/users/7635471/nick-fortescue
hi @kelson42 ,
Yes in custom app we are downloading zim file initial on a first run.
@MohitMaliFtechiz Do we include dependences that we don’t use in custom apps?
@kelson42 No, Our project is divided into modules that are core
, main
, and custom
. Android system automatically detects which dependencies we should use or not by gradle.
@julianharty I think this ticket is completed. We know why the custom apps rely on fetch library. We do so, because in our experience the download of custom apps, i don't know the details but based on Google backend, is or has not been always reliable. Therefore we jave a fallback based on http://download.kiwix.org/zim. Does that makes sense to you? Do you see a problem with this way of doing? Do you recommend an other approach?
@kelson42 If we're willing to continue using Google's download services in a Google build of our Android apps that'd make sense to me. For builds that would be distributed elsewhere (e.g. F-Droid) the dependency on Google is counter-productive (as I expect you know) and having the custom app download from http://download.kiwix.org/zim (ideally in a way that allows for the download to pause and continue from where it left off) would be good from a user-experience perspective. As you may recall when @mhutti1 and others developed the custom downloader code it used to support pause and continue but the code became too buggy and reliable to maintain in the codebase.
If I've understood correctly the Fetch library is - in turn - causing issues these days (see https://github.com/kiwix/kiwix-android/issues/2904 and https://github.com/kiwix/kiwix-android/issues/2907). If so then in the longer term perhaps we'll find a replacement for Fetch that's more reliable and performant? As Kiwix 3.6.0 hasn't yet been launched in Google Play (from what I can tell we are rolling out 3.4.5 currently) we don't yet know if the fix mentioned in https://github.com/kiwix/kiwix-android/issues/2907#issuecomment-1210704877 is effective.
hi @kelson42 ,
Since Fetch is no more maintain we should starting finding alternative of fetch library. https://github.com/kiwix/kiwix-android/issues/3141
@kelson42 If we're willing to continue using Google's download services in a Google build of our Android apps that'd make sense to me. For builds that would be distributed elsewhere (e.g. F-Droid) the dependency on Google is counter-productive (as I expect you know) and having the custom app download from http://download.kiwix.org/zim (ideally in a way that allows for the download to pause and continue from where it left off) would be good from a user-experience perspective. As you may recall when @mhutti1 and others developed the custom downloader code it used to support pause and continue but the code became too buggy and reliable to maintain in the codebase.
If I've understood correctly the Fetch library is - in turn - causing issues these days (see #2904 and #2907).
#2904 is linked to ObjectBox, not fetch. We are working to remove ObjectBox dependence. #2907 is still unclear to what this is related.
If so then in the longer term perhaps we'll find a replacement for Fetch that's more reliable and performant? As Kiwix 3.6.0 hasn't yet been launched in Google Play (from what I can tell we are rolling out 3.4.5 currently) we don't yet know if the fix mentioned in #2907 (comment) is effective.
The fetch library is not perfect (lack of features and not maintained) but mostly does the job. We will replace it in milestone 3.8 mostly because this is not maintained. But regarding your initial request, I believe this is clearly explained now why we have it in custom apps. I'm relunctant to fully rely only on it (or its replacement) for custom apps, because this makes a custom app installation process in two steps which is not the case with the current system in Google Play.
I might reassed all of this, but this is an other story :)