-
Notifications
You must be signed in to change notification settings - Fork 7
Add cards directly to AnkiDroid #454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Tim, thanks for letting me know - this looks very promising. I will definitely look at this and I'll let you know. |
Hi Tim, thank you very much for the example app. I have looked at the app (also on the FlashCardsContract.java file). It is however not clear to me how can I create a new deck with multiple cards via the API - for example what value should I fill into fields such as Note.GUID or the like. Can you please help me with this? |
Hi Martin, as written in the contract, Note.GUID is read-only... This value is generated automatically by AnkiDroid when you do an I haven't really looked at the example app in detail (it was written by @federvieh who also wrote all the API code), but if it's not clear how to add cards from the example app source code, you might want to look at the test cases in AnkiDroid instead. Please create a new issue on the example app page as well to let @federvieh know how that app can be improved. |
Hi Martin, Tim,
my intentions with the “example app” were more to provide a proof of
concept and not so much to serve as an example for developers. Of course it
may serve a different purpose now. But I think that currently the test
cases and examples in the contract provide better examples of the API usage.
Anyway, feel free to raise new issues on the example app or ask questions
on the AnkiDroid list. I'll do my best to answer questions or discuss new
features.
|
By the way, any progress on this? I'm hoping to go into beta in the next month or so, it would be nice if we could get beta testers to test Aedict integration at the same time. |
No progress right now. I will need an example code on how to mass-import entries from Aedict. I do not use AnkiDroid myself, so I do not know what users want - they probably want to create a Deck of cards or something. Please give me API which will allow to create a Deck with a list of cards, without doing mumbo-jumbo with the low-level ContentProvider with tons of undocumented fields. |
@mvysny The sample app is modeled roughly around how I'd like you to implement the feature in Aedict (as a regular user of Aedict) |
Thank you, the API looks great! |
Thanks! I definitely urge you to check the sample app; you should be able to use parts of it verbatim such as the ACTION_SEND fallback mechanism, the custom AnkiDroid model for Japanese words, and the runtime permissions check for Android 6 compatibility, etc. I would recommend that you use a separate custom AnkiDroid model for Kanji, rather than trying to reuse that model for both words and kanji. For example Aedict users probably want some extra information such as the stroke count, and they probably don't need some information like the example sentences. |
Hmm, I am still using the Android Maven plugin to build Aedict. Is the com.ichi2.anki:api:1.0.0alpha2 artifact available in a Maven repository? Or can I grab jar (or sources) of the project and build it myself? Thanks :) |
Hi Martin, yes it's on JCenter Android studio / gradle is now the official build tool for Android though, On 15/09/2015 4:11 pm, "Martin Vysny" notifications@github.com wrote:
|
Thanks Tim, I will give it a try and I will let you know. Yes, I am already using Gradle for several projects and I like it. Yet, I am quite new in Gradle and still gaining experience needed to port as complex project as Aedict3 is, from Maven to Gradle. |
Any ETA for this? The whole reason why I built the API was so that I could use it with Aedict tbh! We are going into beta cycle for v2.5 very soon |
Sorry man, I was otherwise engaged. I learned that the API won't work with AnkiDroid from Google Play, so I decided to wait. I once implemented an Intent which still does not work with AnkiDroid, remember? I wanted to avoid that - I wanted to give users something that works out-of-the-box. |
You don't need a "custom build" per se, but yes you do need to install the latest development version. The 2.5 beta version should be out in the next week or so, and unless the rapture comes, AnkiDroid 2.5 will be released to Google Play before the end of November!
I recommend using the custom model provided in the sample app. I designed this model for Aedict ;) |
Great! Any chance you could migrate the aedict 2.9 source code over to gradle as well? It would be nice to add at least rudimentary support for the AnkiDroid API to Aedict 2, as many open source enthusiasts still use it. |
Sorry mate, but I hardly find the time to maintain Aedict3 (and adjacent apps, say, Aedict Reader) - I have no spare time to maintain A2. I would open-source A3 gladly, but that will be an end to paid Aedict3 (and an end of my development of A3) |
In Aedict 3.38.7 a please-wait dialog is shown while the export is performed. I believe that the export is implemented from my side, closing as fixed. |
Hi, Tim here from AnkiDroid.
I apologize that our last discussions on a new add intent (#264) never materialized into anything... I guess @diogovk lost the time to contribute to AnkiDroid, as is so often the case in open source projects.
However, I have some good news to report! After a lengthy discussion, we decided to abandon the idea of a more complicated add intent, and instead implement a full
ContentProvider
, which gives a high level interface that external developers can use to commit cards directly to the AnkiDroid database.We have just merged a PR (ankidroid/Anki-Android#725) implementing the first version of the provider (available as of v2.5 alpha9), and there is an example app available (unrestricted free license) which demonstrates the basic usage of the provider.
I think it would be a great addition to Aedict if you use this new interface to add cards to AnkiDroid instead of the old interface. The API has not been finalized yet (for example adding new note types is not supported yet, which would be highly beneficial for Aedict), but it's ready to explore and start prototyping with, so please feel free to play around with it and suggest changes to the API according to your requirements.
The text was updated successfully, but these errors were encountered: