Read More

How to create a JSONArray from a json file

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. : )

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close