title: google books api retrofit
body: <p>I am trying to use the google books API with <a href="http://square.github.io/retrofit/" rel="nofollow">Retrofit</a>, it is returning an empty result. </p>
  
  <p>this is the url:<br>
  <a href="https://www.googleapis.com/books/v1/volumes?q=9781451648546" rel="nofollow">https://www.googleapis.com/books/v1/volumes?q=9781451648546</a></p>
  
  <p>In Retrofit I have an interface:</p>
  
  <pre><code>public interface IServiceEndPoint {
    @GET("https://www.googleapis.com/books/v1/volumes?q=9781451648546")
    Call&lt;BookList&gt; getBooks();
  }
  </code></pre>
  
  <p>in my <code>webservice class</code> I have the following method:</p>
  
  <pre><code>public void getBooks(final Callback&lt;BookList&gt; callback){
    IServiceEndPoint endPoint = mRetrofit.create(IServiceEndPoint.class);
    Call&lt;BookList&gt; call = endPoint.getBooks();
    call.enqueue(callback);
  }
  </code></pre>
  
  <p>in the <code>activity class</code> I have the method:</p>
  
  <pre><code>private void getBooks(){
    WebserviceHelper.getmInstance().getBooks(new Callback&lt;BookList&gt;() {
      @Override
      public void onResponse(Call&lt;BookList&gt; call, Response&lt;BookList&gt; response) {
        mBooks = response.body().getResults();
        mBookAdapter.update(mBooks);
      }
  
      @Override
      public void onFailure(Call&lt;BookList&gt; call, Throwable t) {
  
      }
    });
  }
  </code></pre>
  
  <p>I have a Java class <strong>Book</strong> and <strong>BookList</strong>.</p>
  
  <pre><code>public class Book implements Serializable {
  
      @SerializedName("id")
      private String id;
      @SerializedName("title")
      private String title;
  public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  }
  
  public class BookList extends Book implements Serializable {
      @SerializedName("results")
      private List&lt;Book&gt; results;
  
      public List&lt;Book&gt; getResults() {
          return results;
      }
  
      public void setResults(List&lt;Book&gt; results) {
          this.results = results;
      }
  }
  </code></pre>
  
  <p>In the manifest file I added</p>
  
  <p>uses-permission android:name="android.permission.INTERNET</p>
  
  <p><strong>mBooks</strong> is returning null value, how could I solve this?<br>
  Thank you.</p>
  
  <p><strong>EDIT:</strong> <em>shuvro</em>'s answer helped me correcting the problem. I also forgot to include the volumeInfo in my Book class. My book class looks as followed now:</p>
  
  <pre><code>public class Book implements Serializable {
  
      @SerializedName("id")
      private String id;
  
      private VolumeInfo volumeInfo;
  
      public VolumeInfo getVolumeInfo() {
          return volumeInfo;
      }
  
      public void setVolumeInfo(VolumeInfo volumeInfo) {
          this.volumeInfo = volumeInfo;
      }
  
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
  }
  </code></pre>
  
  <p>Additionally I created the class volumeInfo:</p>
  
  <pre><code>public class VolumeInfo {
      private String title;
      private String subtitle;
      private String publisher;
      private String description;
  
      public String getSubtitle() {
          return subtitle;
      }
  
      public void setSubtitle(String subtitle) {
          this.subtitle = subtitle;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      public String getPublisher() {
          return publisher;
      }
  
      public void setPublisher(String publisher) {
          this.publisher = publisher;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  }
  </code></pre>
  
  <p>Thanks all for the help!</p>