Closed viivgit closed 1 year ago
As per discussion on https://github.com/ankidroid/Anki-Android/issues/3896 and linked issues, the feature was removed
The feature saw very little use, its implementation was brittle (and had been for nearly a decade) and Android has moved on with better ways to implement it
I feel it would be much better implemented as a third party app which extends the Android system context menu. This would extend any app/WebView with dictionary lookup, instead of only working with AnkiDroid
Alternately, it'll be a candidate for JS Add-ons, when we get the implementation over the finish line
Ah ok I see, that is disappointing since I was heavily using it (probably 10 times /day) but I guess it was somehow hard to maintain so it had to go.
I have a follow-up question then, to see if there could be a workaround in the meantime: In Settings->Advanced->Plugins subsection there is 'Third-party API apps', which redirects to a GitHub page where you can see apps that make use of AnkiDroid's API. The one I was using as a lookup dictionary is Aedict3 Japanese Dictionary (second on that long list), which is actually the first dictionary mentioned in that PR that deleted this function (#8263). The thing I don't understand then is why when I select a character/word/sentence/whatever, then the ... menu does not show me Aedict3 (but does show me other apps that I can export the selected data too, even some unlisted ones like Yomiwa, another Japanese dictionary I use). Is it because these other apps expose themselves to the system context menu (and thus that has nothing to do with AnkiDroid)? And the fact that Aedict3 is still listed in the 'Third-party API apps' is then because it can export data to AnkiDroid's API still, which has nothing to do with the problem here ?
I am just trying to understand how this lookup feature was working before. Was it hardcoded in AnkiDroid for selected few chosen apps (Aedict, leo.org, etc.), or did AnkiDroid expose some feature (now removed) that other apps available on an Android device could tap into, and if yes, how was this different from the regular API access ?
Again, I am just trying to understand to see how I still could get access to that lookup search more easily, or what would be necessary to the Aedict3 developer to make this happen (maybe having a system context menu for Aedict3 is not hard, I have no idea).
The context menu items in a WebView are defined by Android, not by AnkiDroid. It's the Aedict3 developer's responsibility. BUT it's not a significant amount of work to do this in your own app if Aedict3 isn't responsive to making changes
The AnkiDroid implementation had a hardcoded list of dictionaries (and I believe one hardcoded app, instead of a website)
A dictionary can decide to define a menu system-wide.
You can see and use our (GPL) code which was for the lookup feature here: https://github.com/ankidroid/Anki-Android/pull/10341/files
It wouldn't be difficult to define an app to use the code above to define a system menu which does as you require.
I suspect there will already be an open source dictionary app which will let you define your own shortcuts
Reproduction Steps
Expected Result
The magnifying glass icon for lookup appears at the top right of the card. (If you press it launches a search for instance in another app of what you selected)
Actual Result
The magnifying glass icon does not appear at the top right of the card.
Debug info
AnkiDroid Version = 2.16.2
Android Version = 13
ProductFlavor = play
Manufacturer = Google
Model = Pixel 6a
Hardware = bluejay
Webview User Agent = Mozilla/5.0 (Linux; Android 13; Pixel 6a Build/TQ3A.230705.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/115.0.5790.166 Mobile Safari/537.36
ACRA UUID = 4d0e3b24-530f-4fe3-b539-1f87022286e1
New schema = false
Scheduler = std2
Crash Reports Enabled = true
DatabaseV2 Enabled = true
Research