[Feature request] Support add to Anki API
Here is the docs: https://github.com/ankidroid/Anki-Android/wiki/AnkiDroid-API
It might be killer-feature for language learners while seems to be relatively simple to implement.
Plus one to that!
Sound a good idea.
I've been poking around for a day or two. I've been able to integrate into Aard Anki's demo and registering some example data upon an user bookmarking a word.
After finding why my custom data crash the application I would like to add the word beeng bookmarked. This mean I need to retrieve from ArticleFragment.onOptionsItemSelected the current word and its possible meanings. It seems that the article fragment has only an URL that is used to display it.
What would be the easiest way to retrieve what I want from this?
Thnaks, hoping to do a PR a soon as possible =)
I have a working prototype (branch anki-exporter) that cover my needs: upon bookmarking a word, a card is created in Anki with the word and its definition (check for duplicate). It is partly based on Anki Api Sample APP (aka, I have copy/pasted some bits of cod and made some tweaks).
Right now, there is
- no deletion of un-bookmarked words (the API seems unable to do it).
- All cards are put within a single deck
- I don't deal with permissions as shown in the sample App as 1/ it works 2/ I did not manage to get the code to compile
- The export feature works only if in the article, the word is within a
<h1></h1>tag. As all dictionaries do not have same page format, it won't work as it is with all dictionaries. I have only tested it with WordNet english.
From a personal point of view, I could call it a day but I think a PR based on my code would not be accepted. So I think I'll continue working on this relatively slow pace on it. Also; as the app is not well documented and I'm by no mean an Android dev, I would really appreciate having a chat with @itkach to ask some questions in order to speed things up.
Four-year anniversary!
I'll give this a try. It's probably good to implement it as an option in the drop-down menu of an article, that can be toggled in the settings (i.e. "show Anki export option in menu"). I've so far added a toggle to settings - branch "add-anki".
Edit: the toggle now controls the visibility of the export option.