AnkiDroid tries to open APK files

523 views
Skip to first unread message

Andrew Fleury

unread,
Mar 8, 2016, 4:31:49 AM3/8/16
to public...@ankidroid.org
Hi Ankidroid team,

Thanks for the great app and enabling me to use Anki on the go in a much more convenient way than AnkiWeb.

I wanted to point out that Anki seems to try to open most .apk files (application files). It does this whenever I use the stock file browser (5.1) or tapping the download finished notification for an APK file. However, it does not attempt to open the APK when I open the file through third party browsers (Root Browser, ES Explorer, Solid Explorer, etc.). When Anki tries to open a file, I get the error "This isn't a valid apkg file". The odd thing is, I just now found one file that Anki does not try to open - that is the Tasker beta APK for Android 4.0+ downloaded from here: http://tasker.dinglisch.net/download.html

There are no defaults set under the application settings as I can't "Clear defaults" under Launch by Default.

While this doesn't impair the functioning of Anki in any way, it's rather inconvenient and annoying. Hopefully you can fix the way Anki identifies deck files because at the moment it tries APKs as APKGs.

Unless of course somehow my phone settings got messed up and you can point me in the right direction to fix them.

Cheers,
Andrew

Tim

unread,
Mar 8, 2016, 10:06:03 AM3/8/16
to AnkiDroid, public...@ankidroid.org, andrew...@gmail.com
Does it happen with the alpha version? What do you mean by "stock browser", what device is it?

Andrew Fleury

unread,
Mar 8, 2016, 9:17:41 PM3/8/16
to Tim, AnkiDroid, public...@ankidroid.org
Hi Tim,

By "stock browser", I mean using the stock Downloads app to access recently downloaded files on the phone (or tapping the notification that a download is complete). I'm using an LG G4 (H815T).

I installed the Alpha, and now when I try to open APKs from the Downloads app/directory I get an Android error of "Cannot open file." This is leading me to believe there's something wrong with how Android is handling APKs instead of Anki. Would you agree?

Thanks for your help.

Andrew

Tim Rae

unread,
Mar 8, 2016, 9:30:40 PM3/8/16
to Andrew Fleury, AnkiDroid, public...@ankidroid.org
Where are you downloading the files from? Did the AnkiDroid alpha APK from github open correctly? The "Downloads" app is kind of retarded, it only tells the Android system the MIME type of the downloaded file, not the file extension. It sounds like your APK files are being assigned the "application/zip" MIME type instead of the expected "application/vnd.android.package-archive". It's most likely a problem with the site you're downloading from. Since apkg files are also essentially zip files, AnkiDroid was getting confused.

Andrew Fleury

unread,
Mar 8, 2016, 9:32:34 PM3/8/16
to Tim Rae, AnkiDroid, public...@ankidroid.org
Hm, interesting. My APKs are from XDA. Could the browser I use to download APKs affect the assigned MIME type?

Tim Rae

unread,
Mar 8, 2016, 9:33:51 PM3/8/16
to Andrew Fleury, AnkiDroid, public...@ankidroid.org
Probably, try using the stock browser

Andrew Fleury

unread,
Mar 8, 2016, 9:34:58 PM3/8/16
to Tim, public...@ankidroid.org, AnkiDroid

I'll give that a try later today and update you. Thanks for your help.

Andrew Fleury

unread,
Mar 18, 2016, 1:01:59 AM3/18/16
to Tim, public...@ankidroid.org, AnkiDroid
Hi Tim,

Sorry for the very belated response - I got caught up in other things and forgot to go back and check this.

Sure enough, downloading the faulty APK files through another browser fixed the MIME problem. (FYI, I was using Flynx previously, but switched to Chrome to re-download).

Thanks for putting me in the right direction, and again, thanks for building such a great app for us.

Cheers,
Andrew
Reply all
Reply to author
Forward
0 new messages