mvysny / aedict

Original Aedict 2 source codes
http://www.aedict.eu
GNU General Public License v3.0
40 stars 7 forks source link

Export to Ankidroid Updates #971

Closed topherbuckley closed 1 year ago

topherbuckley commented 1 year ago

Hello Martin, long time no contact.

It appears the export to Ankidroid feature has been removed/modified in the 2022/08/30 update (or maybe earlier and I didn't notice). Is there documentation on how this is now supposed to work? I heavily depended on this feature and cannot seem to replicate the old behavior now. All I see now is "Export to Anki-compatible CSV" and Share (First Entry Only). See screenshot below:

Screenshot_20220908-144107

Neither of these appear to work as the old "Export to Anki Card" option did. The latter appears to be the closest representation, but it doesn't seem to include any example sentences or otherwise.

Is there any way to mimic the old behavior? Otherwise I'd be keen to revert back to a previous version for the time being. Are you able to provide older apks or another method for reverting?

Cheers

mvysny commented 1 year ago

Hi, the support for AnkiDroid is still present in Aedict. If Anki is detected, there should be the "Export to AnkiDroid" menu item available in Aedict. Perhaps something changed in AnkiDroid itself? I'm using the com.ichi2.anki:api:1.1.0.alpha5 client which actually comes from the AnkiDroid guys, could it be that it's getting old? The ichi2.anki client code looks up content provider "com.ichi2.anki.flashcards" and sends the flash cards there directly. It would be good to confirm with the AnkiDroid guys that this protocol is still available.

topherbuckley commented 1 year ago

Thanks for the follow up. I'm using the 2.15.6 version from the Google Play store, which appears to be last updated Jul 14, 2021. I use this function quite frequently, so I'm sure I would have noticed this missing between then and now had it been caused by an update to AnkiDroid back in 2021. So I'd be inclined to think its something on the Aedict side. Happy to take a look at any diffs from the recent update if you'd like help searching for something that may have caused it to break.

topherbuckley commented 1 year ago

Although I didn't update my system anytime recently, since you think this is a bug, I'll add my system details:

Device: Pixel 3a OS: Android 11 Build #: RQ1A.210105.002

Let me know if you need anything else.

StarryJapanNight commented 1 year ago

Same issue. Lost ability to export to Anki in the last few days.

Pixel 6. Android 13

mvysny commented 1 year ago

Thanks for letting me know. Let me try on my Android 12 phone 👍

mvysny commented 1 year ago

Reproduced on my phone. I have filed a bug upstream, let's discuss this with the AnkiDroid guys :+1: https://github.com/ankidroid/Anki-Android/issues/12369

mvysny commented 1 year ago

After targeting SDK 30, I didn't knew that I had to add a magic XML to AndroidManifest:

    <queries>
        <package android:name="com.ichi2.anki" />
    </queries>

As per https://developer.android.com/training/package-visibility/declaring

Adding the <queries> element fixed the issue and now Aedict works with AnkiDroid again.

Fixed in Aedict 3.50.25. I'll release a fixed version today.

mvysny commented 1 year ago

Aedict 3.50.25 released, please wait a day or two for it to get reviewed by Google and then made available.

topherbuckley commented 1 year ago

Confirmed working! Thanks for your always speedy replies and resolution Martin!