I have the following textfile into my SdCard.now i want to parse this file via Json parser,and i want to parse and read this file and display data into my textview,how i can do this?
{
"data": [
{
"id": "1",
"title": "Farhan Shah",
"duration": 10,
},
{
"id": "2",
"title": "Noman Shah",
"duration": 10,
},
{
"id": "3",
"title": "Ahmad Shah",
"duration": 10,
},
{
"id": "4",
"title": "Mohsin Shah",
"duration": 10,
},
{
"id": "5",
"title": "Haris Shah",
"duration": 10,
}
]
}
This is the code:
File sdcard = Environment.getExternalStorageDirectory();
//Get the text file
File file = new File(sdcard,"textarabics.txt");
String UTF8 = "utf8";
int BUFFER_SIZE = 8192;
//Read text from file
StringBuilder text = new StringBuilder();
i get the file,but now i have no idea that how i can parse the data?