2013年3月18日 星期一

[Android] JSON Parser

 private static final String TAG_RESULTS = "results";
 private static final String TAG_ID = "name";


JSONParser jParser = new JSONParser();
  JSONObject json = jParser.getJSONFromUrl(url);
  try {

    results = json.getJSONArray(TAG_RESULTS);
   mString = new String[results.length()];

    for (int i = 0; i < results.length(); i++) {
    JSONObject c = results.getJSONObject(i);

     String id = c.getString(TAG_ID);

  

    }
  } catch (JSONException e) {
   e.printStackTrace();
  }

沒有留言:

張貼留言