Code example for JSONArray

Methods: length

0
    this.raw=raw;
    chapters=raw.optJSONArray("chapters");
  } 
 
  int getChapterCount() { 
    return(chapters.length());
  } 
 
  String getChapterFile(int position) {
    JSONObject chapter=chapters.optJSONObject(position);
 
    return(chapter.optString("file"));
  } 
 
  String getTitle() {
    return(raw.optString("title"));
  } 
}