I am new to IONIC. I wanted to know what is the ideal choice for storage. Should i use ionic storage for that?
Also i need to manually enter some data for the app. Now i can’t find any way to store data beforehand, is this possible in ionic?
I am new to IONIC. I wanted to know what is the ideal choice for storage. Should i use ionic storage for that?
Also i need to manually enter some data for the app. Now i can’t find any way to store data beforehand, is this possible in ionic?
Yes, Ionic Storage is a well supported solution.
Can you clarify? I don’t understand.
Thanks for replying.
Lets say i need a database/storage pre-filled with some values. How can i do that? Is that possible or i need to get the data from cloud?
Super simple solution: On start you check if a special value is set, e.g. databasePreloaded
. If it is missing, you open a file, read the content and write it to the storage. Then you set databasePreloaded
. On next start it will be present and the data won’t be loaded again.
Thanks a lot, i got it.
For educational purpose, what if the pre-filled data is around 5-6MB, is it wise to read the content from a file or there is any alternative?
That could indeed be a problem as it will take some time - best test it if it is acceptable.
Depending on what backend is used by Ionic Storage (which can be configured), you might be able to just provide the file that is used as “database” yourself maybe - I have no experience with that. Ionic Storage is a wrapper around another library, googling for that one might help.