title: JSONparsing in google books api
body: <p>I am trying to get results from this google books api "<a href="https://www.googleapis.com/books/v1/volumes?q=android&amp;maxResults=20" rel="nofollow noreferrer">https://www.googleapis.com/books/v1/volumes?q=android&amp;maxResults=20</a>"</p>
  
  <p>The code for Json parsing is </p>
  
  <pre><code>try {
              JSONObject root = new JSONObject(booksJson);
              JSONArray books = root.getJSONArray("items");
              for (int i = 0; i &lt; books.length(); i++) {
                  JSONObject book = books.getJSONObject(i);
                  JSONObject info = book.getJSONObject("volumeInfo");
                  String title = info.getString("title");
                  JSONArray authors = info.getJSONArray("authors");
                  String author = authors.getString(0);
                  JSONObject imageLinks = info.getJSONObject("imageLinks");
                  String imageLink = imageLinks.getString("smallThumbnail");
                  Book bookObject = new Book(author,title,imageLink);
                  booksList.add(bookObject);
                  Log.d(LOG_TAG + " Index :", String.valueOf(i) + "  :  " + String.valueOf(books.length()));
              }
          } catch (JSONException e) {
  
          }
  </code></pre>
  
  <p>Problem is that there are 20 results when I check in web browser and it also shows 20 results when I log books.length() in logcat but It skips some books and shows fewer results as expected. Please Help.</p>