Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
844 views
in Technique[技术] by (71.8m points)

java - How to Parse the JSON String Android

I'm trying to Parse the below JSONString

[[{"0":"
","title":" Technical Support Analyst in Noida","1":"
","Company Name":" Oracle","2":"
","Category":"Fresher","3":"
","Job Type":"Full Time","4":"
","Location":"Noida","5":"
","Job Qualification":"BE/BTch/Bsc/Others","6":"
","Job Experience":"Freshers","7":"
","Job postdate":"2013-6-05","8":"
"}]]

Here My Code:

// try parse the string to a JSON object
try {
    //jObj = new JSONObject(JsonString);
    JSONArray ja = new JSONArray(result);
    int size = ja.length();
    Log.d("tag", "No of Elements " + ja.length());
} catch (JSONException e) {
    Log.e("JSON Parser", "Error parsing data " + e.toString());
}

Could any one help,My Code is not Working? I want to Parse title,CompanyName,Category Etc...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Take a look at this Json parsing guide using native tools and Gson library that I wrote:

Json Parsing

Maybe you will find it useful. You can download the full project from there as well to run and test it for yourself.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...