You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 insert() operation. You then use update() to set the field values and I believe a new deck will automatically be created if you set one that doesn't exist, which maybe isn't the best solution.
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.
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 :)
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?
—
Reply to this email directly or view it on GitHub #454 (comment).
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.
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.
If I understand correctly, I need custom build of AnkiDroid to test this, is this correct? I already migrated Aedict to Gradle, so this should be a lot easier by now.
Do you have any recommendations for Aedict to create some more complex card model, or is the basic model enough for now?
If I understand correctly, I need custom build of AnkiDroid to test this, is this correct?
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!
Do you have any recommendations for Aedict to create some more complex card model, or is the basic model enough for now?
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.
Any chance you could migrate the aedict 2.9 source code over to gradle as well?
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)
Activity
mvysny commentedon Mar 24, 2015
Hi Tim, thanks for letting me know - this looks very promising. I will definitely look at this and I'll let you know.
mvysny commentedon Apr 16, 2015
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?
timrae commentedon Apr 16, 2015
Hi Martin, as written in the contract, Note.GUID is read-only... This value is generated automatically by AnkiDroid when you do an
insert()operation. You then useupdate()to set the field values and I believe a new deck will automatically be created if you set one that doesn't exist, which maybe isn't the best solution.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.
federvieh commentedon Apr 17, 2015
timrae commentedon Jun 17, 2015
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.
mvysny commentedon Jun 17, 2015
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.
timrae commentedon Sep 12, 2015
@mvysny
Your wish is my command:
https://github.com/ankidroid/Anki-Android/wiki/AnkiDroid-API
The sample app is modeled roughly around how I'd like you to implement the feature in Aedict (as a regular user of Aedict)
mvysny commentedon Sep 14, 2015
Thank you, the API looks great!
timrae commentedon Sep 14, 2015
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.
mvysny commentedon Sep 15, 2015
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 :)
timrae commentedon Sep 15, 2015
Hi Martin, yes it's on JCenter
https://jcenter.bintray.com/com/ichi2/anki/api/1.0.0alpha2/, which is the
Android Studio default. Can you use that with the Android Maven plugin?
Android studio / gradle is now the official build tool for Android though,
and it's pretty good, so you might want to consider changing over.
On 15/09/2015 4:11 pm, "Martin Vysny" notifications@github.com wrote:
mvysny commentedon Sep 16, 2015
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.
timrae commentedon Oct 8, 2015
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
mvysny commentedon Oct 8, 2015
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.
If I understand correctly, I need custom build of AnkiDroid to test this, is this correct? I already migrated Aedict to Gradle, so this should be a lot easier by now.
Do you have any recommendations for Aedict to create some more complex card model, or is the basic model enough for now?
timrae commentedon Oct 8, 2015
@mvysny
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 ;)
timrae commentedon Oct 8, 2015
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.
mvysny commentedon Oct 8, 2015
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)
mvysny commentedon Oct 12, 2015
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.