Check Mobile App
Read now
Start a Project

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

Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.

Stathis Plakidas

Stathis Plakidas

Talk to Sales

Global

Live Chat
Start a Project

    Message Sent!

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

    Back to Home