Skip to content
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

Make it work on Mobile #20

Closed
tyalie opened this issue Nov 12, 2019 · 11 comments
Closed

Make it work on Mobile #20

tyalie opened this issue Nov 12, 2019 · 11 comments

Comments

@tyalie
Copy link

tyalie commented Nov 12, 2019

Wouldn't it be awesome to have this also available on mobile apps?

I know that the add in is currently written in Python and as such unfit for mobile use, but moving to JavaScript would remove this issue.

@jcklie
Copy link
Owner

jcklie commented Nov 12, 2019

The writing itself is Javascript, I tried to use it on mobile Anki but it did not work for me. Also, mobile does not have a plugin system. You can try to paste the javascript into a card template and see how it works for you.

@tyalie
Copy link
Author

tyalie commented Nov 12, 2019

I'll see.

@tyalie
Copy link
Author

tyalie commented Nov 12, 2019

Hey. You've a better understanding of the code.
What are the required files? I assume that rice.svg and field.svg must both be in the same folder as the script. Do I need any other files?

@tyalie
Copy link
Author

tyalie commented Nov 12, 2019

Oke. Got it working for one card, as I wrote the script, that you generate dynamically directly into the card. Know the question is, how to make this available for each card, by storing it on generation.

@jcklie
Copy link
Owner

jcklie commented Nov 12, 2019

I would not use any of my code, but just directly the hanziwriter javascript. Then you can just use the field in the card you want to query for.

@tyalie
Copy link
Author

tyalie commented Nov 18, 2019

Yep. I've written a small Javascript to make it work. It can be found here:
https://github.com/Gansgar/Anki-Chinese/tree/anki-web

@arueckle
Copy link
Collaborator

arueckle commented Jan 26, 2020

I created a mobile fallback for maobi. Instead of the drawing canvas, it shows an input field with automatic validation. It only activates when maobi is not loaded. I use it together with the handwriting input keyboard on iOS and it works well so far. One downside is, however, that it does not show you the correct stroke order.

To use the fallback, add the code of the following snippet to the front template of the maobi card.

https://gist.github.com/arueckle/ee75416b30f5b4e7c7d5d815036ec08b

This is how it looks like on iPad:

maobi-fallback

jcklie added a commit that referenced this issue Jan 26, 2020
- Add workaround description
jcklie added a commit that referenced this issue Jan 26, 2020
- Add workaround description
@krmanik
Copy link

krmanik commented Mar 13, 2020

I have implemented it but due to character encoding it is failed to load in Ankidroid.

https://github.com/infinyte7/Anki-maobi

It is working on AnkiDesktop but due to character encoding It is not working in Ankidroid. I have tried many solutions but It is failed to load.
In Anki Desktop character length is correct but in Ankidroid same character length is incorrect.
Ex:- '比如'
In Anki Desktop Length is 2,
In Ankidroid Length is 7

So may be there is error due to character encoding in Ankidroid webview.

@krmanik
Copy link

krmanik commented Mar 14, 2020

Finally I have implemented it for Ankidroid check this.
https://github.com/infinyte7/Anki-xiehanzi

@jcklie
Copy link
Owner

jcklie commented Mar 15, 2020

Thank you! I linked your repository in the readme. I will close this issue for now, we have now 2 alternatives for mobile. It would be nice though if you could choose a different name for you project, as now there are two maobi projects which are not related.

@jcklie jcklie closed this as completed Mar 15, 2020
@krmanik
Copy link

krmanik commented Mar 15, 2020

okay, I will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants