kiwix / kiwix-android

Kiwix for Android
https://android.kiwix.org
GNU General Public License v3.0
890 stars 447 forks source link

In Samsung tablet of Android 14, downloaded files can not be opened via file picker or deep linking. #4008

Closed MohitMaliFtechiz closed 2 weeks ago

MohitMaliFtechiz commented 1 month ago

Describe the bug In Samsung tablet of Android 14, downloaded files can not be opened via file picker or deep linking. However, other zim files I can open via filePicker or deep linking e.g. which are in the document, and in other folders (which I just copy from my computer).

This issue is in the non-playStore variant.

Expected behavior It should open the downloaded zim files as well.

Steps to reproduce the behavior:

  1. Download the application on a Samsung tablet(Android 14).
  2. Download a Zim file via any browser(Chrome, Firefox).
  3. Try to open that ZIM file with Kiwix, You will see the error.

Environment

kelson42 commented 1 month ago

I just installed VLC and downloaded a mp4 file, here is what I get when I try to open the mp4 file from the Samsung file browser Screenshot_20240927_092119_Android System

The result 8s convincing: there is an efficient way for the file browser to propose appropriate apps.

MohitMaliFtechiz commented 1 month ago

@kelson42 This issue is with our getLocalFilePathByUri method, which cannot find the actual path for the provided URI by this tablet. We have to refactor this method to work properly for all the URIS in this issue. e.g. opera provided uri, file manager provided uri etc.

Since the provided path for the tablets is like this when we directly click on the file in file manager content://com.android.providers.downloads.documents/document/msf%3A1000000057 for the downloaded file.

If we click directly from the opera download screen than uri comes like this content://com.opera.browser.DownloadProvider/downloads/beer.stackexchange.com_en_all_2023-05.zim?hash=w4A3vMuc7l1FPQwk23rmbgvfPGJfhcj5FujW37NApdA%3D&mt=application%2Foctet-stream

Here in the VLC player, it directly works with the coming uri without getting its path(Like now we are directly working with the provided uri for PS version in https://github.com/kiwix/kiwix-android/pull/4006). We need the actual path to properly work with the libkiwix(https://github.com/openzim/libzim/issues/852).

About showing VLC in the suggestion list is a different issue, for that, we have an issue https://github.com/kiwix/kiwix-android/issues/4002. Thanks for your testing and feedback. It will be helpful for us in fixing the issue.

kelson42 commented 1 month ago

@MohitMaliFtechiz Which PR fixes this?