http://docs.blackberry.com/sampledata.json
This is my web service and I want to parse and retrieve vehicleType, vehicleColor, fuel, name, experiencePoints, treadType.
public class MainActivity extends Activity {
private static String url="http://maps.googleapis.com/maps/api/directions/json?origin=Tamil%20ndau,Salem&destination=Tamil%20nadu,%20salem®ion=in&sensor=false";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
JSONObject json=JSONParser.getJSONfromURL(url); // here i am able to read content of that web service
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Please tell me how can I get the value? I’m not able to pick node for Json object and Json array. Please tell me what I have to do next so that I can retrieve the value. I am new in Json parsing and android. Please help me.
May be this code help for you
This is parsing code example you can change this.