S
S
SadToDev2019-05-17 01:38:58
Android
SadToDev, 2019-05-17 01:38:58

How to store information for a directory on Android?

I am making a Flutter guide for Android, it has a first aid section, each item leads to a page with instructions. The instructions are the same: symptoms, actions, risks, drugs - all are lists with text fields, but the problem is that in each case the number of list items varies.
How can information be stored?
I tend to sql lite, but I don't know how to implement the structure in this case. You can also probably store each instruction as an html file (create a template and just fill it), but in this case there will be a large number of these files and I don’t think that this approach is correct

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentin V., 2019-05-17
@SadToDev

If the application will not select instructions for the specified fields, then for storage in sqlite, you can simply serialize the data into text, for example, lines separated by a break \n, or json, or the like. When extracting, use deserialization.
If you need to receive data from sqlite with selections or store with some kind of metadata, then through one-to-many relationships:
instruction - symptoms (instruction id, symptom text),
instruction - actions (instruction id, action text; + possibly a serial number)
and etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question