ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.52k stars 2.21k forks source link

Android .apkg file association (PDF files) #4657

Closed gobater closed 7 years ago

gobater commented 7 years ago
Research

Enter an [ x ] character to confirm the points below:

[x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[x ] I have checked the manual and the FAQ and could not find a solution to my issue

[ x] I have searched for similar existing issues here and on the user forum

Reproduction Steps
  1. Install Ankidroid
  2. Download a PDF File with "PDF" (uppercase) extension
  3. Try to open the File (tap in Android download application or pop-up)
Expected Result

The PDF File is opened with the associated application

Actual Result

The PDF File is opened with Ankidroid and an error Message is shown indicating that the File is not a vàlid APKG file

Debug info

Refer to the support page if you are unsure where to get the "debug info".

AnkiDroid Version = 2.8.2

Android Version = 6.0.1

ACRA UUID = 04298d9d-1ad6-48f2-b755-d08e3f711ba2

eginhard commented 7 years ago

AnkiDroid doesn't register itself as being able to open PDF files, so the problem is probably that the MIME type of your PDF file is not set correctly. Do other PDF files open normally?

gobater commented 7 years ago

Yes, other PDF Files open fine.

It has to be something with Ankidroid. If I uninstall Ankidroid, I can open the File without issues

gobater commented 7 years ago

Try this File: https://ufile.io/ig8j1

Screenshot: https://ufile.io/qatuk

eginhard commented 7 years ago

If other PDF files open fine, it shows that this is indeed an issue with this specific file and/or your device rather than AnkiDroid. I don't know what exactly is wrong, but I'm not able to open this file at all from my Downloads app ("Can't open this file") although the MIME type seems to be correctly set to "application/pdf". From a file manager app it correctly opens it in a PDF reader (and AnkiDroid is not among the suggested apps either).

gobater commented 7 years ago

Exactly!! This is the same issue I am experiencing. The only difference of this File with the others is the uppercase extension: "PDF". Uninstall Ankidroid and you will be able to open Ot from the Downloads app

If you see the attached screenshot, it seems that Ankidroid is trying to open the file. I have not tried, but I suspect that renaming the file does the trick...

eginhard commented 7 years ago

It doesn't look like the extension is the problem, but I don't know what exactly is wrong. As I said, it's not an issue with AnkiDroid. The file can't be opened at all from my downloads folder and doesn't have the same icon as other PDF files, so uninstalling AnkiDroid doesn't change anything for me. I can't help you further, but you can try contacting the author of the PDF.

timrae commented 7 years ago

You could use the app "intent intercept" to figure out what exactly is triggering Android OS to use AnkiDroid to open the file. At the end of the day though, it's most likely going to be a problem with the file, as has already been seen.

On 27/06/2017 14:06, "Enno Hermann" notifications@github.com wrote:

It doesn't look like the extension is the problem, but I don't know what exactly is wrong. As I said, it's not an issue with AnkiDroid. The file can't be opened at all from my downloads folder and doesn't have the same icon as other PDF files, so uninstalling AnkiDroid doesn't change anything for me. I can't help you further, but you can try contacting the author of the PDF.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ankidroid/Anki-Android/issues/4657#issuecomment-311254246, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsA4oDCwlX6x4g-gyq6RTInKkZzsQg0ks5sII3pgaJpZM4OD3w3 .

gobater commented 7 years ago

Have you tried to open the PDF after uninstalling AnkiDroid? For me, surprisingly, it works