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

**URL:** <https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826>\
**Category:** Help\
**Created:** [April 27, 2025, 1:07am UTC](https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826 "2025-04-27T01:07:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anki10](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anki10](https://forums.ankiweb.net/u/anki10)\
**Post date:** [April 27, 2025, 1:07am UTC](https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826/1 "2025-04-27T01:07:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SuhasK](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SuhasK](https://forums.ankiweb.net/u/SuhasK)\
**Post date:** [April 27, 2025, 4:58am UTC](https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826/2 "2025-04-27T04:58:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anki10](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anki10](https://forums.ankiweb.net/u/anki10)\
**Post date:** [April 27, 2025, 12:16pm UTC](https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826/3 "2025-04-27T12:16:23Z")

</div>

> [@SuhasK](#):
>
> Persistence

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.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [April 27, 2025, 2:32pm UTC](https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826/4 "2025-04-27T14:32:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anki10](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anki10](https://forums.ankiweb.net/u/anki10)\
**Post date:** [April 27, 2025, 2:54pm UTC](https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826/5 "2025-04-27T14:54:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 27, 2025, 2:54pm UTC](https://forums.ankiweb.net/t/how-to-implement-persistent-saving-forms-in-templates-with-js-api-on-android-on-anki/59826/6 "2025-05-27T14:54:07Z")

</div>

Closed on May 27, 2025, 2:54pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
