How to implement persistent saving forms in templates with JS API on Android on Anki?

I added a form on the front of anki to control the font size of the anki card, you can pass it to the back of anki, switch to the next new card to save the text size of the setting, and exit the learning interface to re-enter, you can also retain the font size set last time, this effect runs normally on the computer anki, i used github persistence script to achieve it, but on the anki android mobile phone, the font size set on the front of the anki card, when i exit the learning interface and re-enter, The font size set last time was restored to default, please tell me what is the storage method of ankidroid, can you use ankidroid js api to achieve it, how to achieve it, the persistent preservation of the state of the front card form, even if you exit the interface again, you can save it, you don’t need to re-set the font size every time you open it

I don’t think the regular (SimonLamer) Persistence script allows cross-session saving of data.
Currently, what are you doing to save the data?

I’m using Persistence.,This doesn’t work in ankidroid.,Exit the learning interface.,The font size set last time is gone.,It’s not saved.,I don’t know if ankidroid is stored locally or what.,I’m using ankidroid js api in the camera to save the state of the front switch setting.,There’s no example to refer to.

Have you looked into using localStorage? It should work universally across all platfroms.

ankidroid’s webview, when I exit ankidroid’s learning interface and re-enter it will be reinitialized, and local storage I tried it didn’t work

1 Like