-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
AnkiDroid API how can i add cards with sound? #5139
Comments
You'd have to make a proposal to extend the API to accept to media, reach an agreement with us on the details, and then implement it and submit a PR. |
how can i do it? |
Think of the API you'd want that the CardContentProvider doesn't have (or maybe we need a MediaProvider to manipulate media then you just reference it using standard CardContentProvider API?). Submit that here for review and we hopefully agree it sounds good. Start implementing it on your github fork and we move from there? |
I afraid to say something stupid). I understand that i can just send audio file to External storage and create link for this file. But i don't know how to send this file proper way. |
Hey - no worries on asking silly questions or proposing things that don't work. I'm currently the king of that here, but I can handle a partner ;-) As far as I know there is simply no "proper way" in existence right now, to store media in the Anki collection via published APIs. If you tried to use external storage privileges to just drop the file in the directory that would work mostly, but it is possible for people to change the AnkiDroid collection storage directory. I bet it is rare, but it is possible. So that will fail sometimes. I am also not sure whether AnkiDroid would correctly detect the change (new file in filesystem) or not - that would need testing. If you wanted to do the slightly improper but fast way of storing the file by filesystem commands then at minimum you would want an API to get the directory, and you'd want to test that AnkiDroid synced the new media file to Ankiweb correctly. I think the "proper" way to do it would be to have a "storeMedia" API in the CardContentProvider (or similar) where you sent the data to the AnkiDroid API via an Android ContentProvider and AnkiDroid added it programmatically. I hope this helps? |
Thank you for a hint.
|
Reproduction Steps
I am creating an android application and i need add some cards with sound. I use AnkiDroid API to do this. In example i did not find out how to do it.
Expected Result
Please can you give some example.
Actual Result
Debug info
Refer to the support page if you are unsure where to get the "debug info".
Research
Enter an [ x ] character to confirm the points below:
[ ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
[ ] I have checked the manual and the FAQ and could not find a solution to my issue
[ ] I have searched for similar existing issues here and on the user forum
The text was updated successfully, but these errors were encountered: