I would like to add a JSON file to my app and read from this file at runtime. I have looked online for how to do this, but most of the information is concerned with reading the file. I cannot find any information online about how to make the file available at runtime. Most of the stuff online seems to be reading from a bundle, but I have no idea how to create a bundle or how to add a JSON file to it. Can someone provide some information?
This is a fairly simple task. This is how you would do it:
PS: Although, as Gurtej suggested, you can directly add your .JSON into project an read it from there. My post answers your query as how we create a bundle and add files to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With