JSon Example In Android

JSon Example in Android

This example explains how to handle JSon parser. It shows how to read and write data to and from a JSon file.


1.) Create a new project by File-> New -> Android Project name it JSonExample.

2.) Write following into main.xml file:




3.) Put INTERNET permission to manifest file:


4.) Run for output.


1.) Create a project named JSonExample and set the information as stated in the image.

Build Target: Android 4.0
Application Name: JSonExample
Package Name: com. example. JSonExample
Activity Name: JSonExampleActivity
Min SDK Version: 14

2.) Open JSonExampleActivity.java file and write following code there:




3.) Compile and build the project.


Comments 9

  1. Very good tutorial. The link from tutorial is not available anymore , so i tried your code with another link but i receive message ” Unfortunately JSonExampleActivity has stopped.
    What cased this error?

  2. I read your blog but there is one confusion that what is strict mode
    new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build());

Leave a Reply

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