Can Anki provide cross platform local persistent storage functionality?

I encountered the following issues when developing and introducing card templates based on single page applications:

I need to use the storage function to save relevant information about the card,
such as :

  • the user’s favorite records of field content
  • Global configuration related to card decks

If such a feature can be supported, combined with user interaction, Anki cards can accomplish many amazing functions.I want to implement a simple function library that can be directly used in templates. Like manipulating the current card data, changing field values, or changing the global configuration of the deck.

If Anki needs such a feature, I am willing to contribute this feature code to Anki and Ankidroid

If this feature cannot be provided, I hope it can be supported on the platforms of Ankidroid and iOS
Storage solutions like: local storage
(or [cookies, sessions] Maybe it can also be used)

Currently, I am trying to use the browser’s localStorage
On the PC side, including Windows and Mac
Not supported on some Android devices
IOS does not support it at all

1 Like

Thank you for your feedback, :smiley:
but it seems that the Anki persistence library does not meet my needs.

What I want to achieve is to save a global configuration related to a card deck,
For example, the unfolding status of a folding block in a card, or whether night mode is enabled. This configuration needs to remain consistent even after the user restarts Anki. The implementation solution on Android uses session storage, which should cause data to be cleared after the user restarts.

And each client’s implementation method is different, which can lead to confusion in persistence processing logic. I want to achieve it through an elegant solution.
Can an area be partitioned from Anki’s persistence space to store such data and provide an open API to manipulate such data?

There are no plans for such functionality at this time, but I will keep an eye on demand.

Okay, thank you for your attention.
I am looking forward to the release of this feature.
If you need to develop this feature, I am very willing to join in