Check Mobile App
Read now

How to create a JSONArray from a json file

Save

Hello Everyone,

This time while working on creating a list for the recycler view, i tried loading it from a json file which i downloaded from internet.

Approach :

  1. Place your json file in your Assests folder.
  2. Create a string and start adding the contents of your json file into this string.
  3. use this string as argument while declaraing your JSONArray.

See, its really simple.

Let me give you example on how to code this approach and get it working.

Now the Function loadJSONFromAsset();

That’s it !

Now you have got your JSONArray and you can use it simply as per your requirements.

Keep coding and keep sharing. : )

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!

Deniel Kerr

Owner and Founder. Opencart

Talk to Sales
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home