title: Retrofit 2 (in Android) after implementation, Where are my JSON elements?
body: <p>I'm implementing a retrofit 2 interface to parse JSON elements (video urls, thumbnails, title etc.)</p>
  
  <p>JSONschema2Pojo resulted in 4 pojo classes, but the main/root one is VideoInfo (never mind implements Parcelable, I'm not yet doing anything with it)
  Is the lack of <code>@SerializedName("....")</code> affects anything, knowing that this was automatically generated by jsonschema2pojo ? UPDATE : generated new pojo classes, this time with Gson annotations <code>(@SerializedName("") and @Expose)</code> but still having the same problem.</p>
  
  <pre><code>import android.os.Parcel;
  import android.os.Parcelable;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class VideoInfo implements Parcelable {
  
      private List&lt;Item&gt; items = new ArrayList&lt;Item&gt;();
      private int pageNumber;
      private int pageSize;
      private int totalCount;
  
      /**
       * No args constructor for use in serialization
       * 
       */
      public VideoInfo() {
      }
  
      /**
       * 
       * @param totalCount
       * @param items
       * @param pageSize
       * @param pageNumber
       */
      public VideoInfo(List&lt;Item&gt; items, int pageNumber, int pageSize, int totalCount) {
          this.items = items;
          this.pageNumber = pageNumber;
          this.pageSize = pageSize;
          this.totalCount = totalCount;
      }
  
      /**
       * 
       * @return
       *     The items
       */
      public List&lt;Item&gt; getItems() {
          return items;
      }
  
      /**
       * 
       * @param items
       *     The items
       */
      public void setItems(List&lt;Item&gt; items) {
          this.items = items;
      }
  
      /**
       * 
       * @return
       *     The pageNumber
       */
      public int getPageNumber() {
          return pageNumber;
      }
  
      /**
       * 
       * @param pageNumber
       *     The page_number
       */
      public void setPageNumber(int pageNumber) {
          this.pageNumber = pageNumber;
      }
  
      /**
       * 
       * @return
       *     The pageSize
       */
      public int getPageSize() {
          return pageSize;
      }
  
      /**
       * 
       * @param pageSize
       *     The page_size
       */
      public void setPageSize(int pageSize) {
          this.pageSize = pageSize;
      }
  
      /**
       * 
       * @return
       *     The totalCount
       */
      public int getTotalCount() {
          return totalCount;
      }
  
      /**
       * 
       * @param totalCount
       *     The total_count
       */
      public void setTotalCount(int totalCount) {
          this.totalCount = totalCount;
      }
  
      @Override
      public int describeContents() {
          return 0;
      }
  
      @Override
      public void writeToParcel(Parcel dest, int flags) {
  
      }
  
  
  }
  </code></pre>
  
  <p><strong>UPDATE</strong>: in the class VideoInfo above you can see <code>private List&lt;Item&gt; items = new ArrayList&lt;Item&gt;();</code> this is because there's another pojo class that has a list of tiems, as follows:</p>
  
  <pre><code>import com.google.gson.annotations.Expose;
  import com.google.gson.annotations.SerializedName;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class Item {
  
      @SerializedName("id")
      @Expose
      private int id;
      @SerializedName("name")
      @Expose
      private String name;
      @SerializedName("shortDescription")
      @Expose
      private String shortDescription;
      @SerializedName("creationDate")
      @Expose
      private String creationDate;
      @SerializedName("publishedDate")
      @Expose
      private String publishedDate;
      @SerializedName("linkURL")
      @Expose
      private String linkURL;
      @SerializedName("linkText")
      @Expose
      private String linkText;
      @SerializedName("tags")
      @Expose
      private List&lt;String&gt; tags = new ArrayList&lt;String&gt;();
      @SerializedName("videoStillURL")
      @Expose
      private String videoStillURL;
      @SerializedName("thumbnailURL")
      @Expose
      private String thumbnailURL;
      @SerializedName("length")
      @Expose
      private int length;
      @SerializedName("renditions")
      @Expose
      private List&lt;Rendition&gt; renditions = new ArrayList&lt;Rendition&gt;();
      @SerializedName("IOSRenditions")
      @Expose
      private List&lt;IOSRendition&gt; IOSRenditions = new ArrayList&lt;IOSRendition&gt;();
      @SerializedName("HDSRenditions")
      @Expose
      private List&lt;Object&gt; HDSRenditions = new ArrayList&lt;Object&gt;();
  
      /**
       * No args constructor for use in serialization
       * 
       */
      public Item() {
      }
  
      /**
       * 
       * @param tags
       * @param videoStillURL
       * @param HDSRenditions
       * @param id
       * @param creationDate
       * @param IOSRenditions
       * @param linkText
       * @param shortDescription
       * @param renditions
       * @param name
       * @param linkURL
       * @param length
       * @param publishedDate
       * @param thumbnailURL
       */
      public Item(int id, String name, String shortDescription, String creationDate, String publishedDate, String linkURL, String linkText, List&lt;String&gt; tags, String videoStillURL, String thumbnailURL, int length, List&lt;Rendition&gt; renditions, List&lt;IOSRendition&gt; IOSRenditions, List&lt;Object&gt; HDSRenditions) {
          this.id = id;
          this.name = name;
          this.shortDescription = shortDescription;
          this.creationDate = creationDate;
          this.publishedDate = publishedDate;
          this.linkURL = linkURL;
          this.linkText = linkText;
          this.tags = tags;
          this.videoStillURL = videoStillURL;
          this.thumbnailURL = thumbnailURL;
          this.length = length;
          this.renditions = renditions;
          this.IOSRenditions = IOSRenditions;
          this.HDSRenditions = HDSRenditions;
      }
  
      /**
       * 
       * @return
       *     The id
       */
      public int getId() {
          return id;
      }
  
      /**
       * 
       * @param id
       *     The id
       */
      public void setId(int id) {
          this.id = id;
      }
  
      /**
       * 
       * @return
       *     The name
       */
      public String getName() {
          return name;
      }
  
      /**
       * 
       * @param name
       *     The name
       */
      public void setName(String name) {
          this.name = name;
      }
  
      /**
       * 
       * @return
       *     The shortDescription
       */
      public String getShortDescription() {
          return shortDescription;
      }
  
      /**
       * 
       * @param shortDescription
       *     The shortDescription
       */
      public void setShortDescription(String shortDescription) {
          this.shortDescription = shortDescription;
      }
  
      /**
       * 
       * @return
       *     The creationDate
       */
      public String getCreationDate() {
          return creationDate;
      }
  
      /**
       * 
       * @param creationDate
       *     The creationDate
       */
      public void setCreationDate(String creationDate) {
          this.creationDate = creationDate;
      }
  
      /**
       * 
       * @return
       *     The publishedDate
       */
      public String getPublishedDate() {
          return publishedDate;
      }
  
      /**
       * 
       * @param publishedDate
       *     The publishedDate
       */
      public void setPublishedDate(String publishedDate) {
          this.publishedDate = publishedDate;
      }
  
      /**
       * 
       * @return
       *     The linkURL
       */
      public String getLinkURL() {
          return linkURL;
      }
  
      /**
       * 
       * @param linkURL
       *     The linkURL
       */
      public void setLinkURL(String linkURL) {
          this.linkURL = linkURL;
      }
  
      /**
       * 
       * @return
       *     The linkText
       */
      public String getLinkText() {
          return linkText;
      }
  
      /**
       * 
       * @param linkText
       *     The linkText
       */
      public void setLinkText(String linkText) {
          this.linkText = linkText;
      }
  
      /**
       * 
       * @return
       *     The tags
       */
      public List&lt;String&gt; getTags() {
          return tags;
      }
  
      /**
       * 
       * @param tags
       *     The tags
       */
      public void setTags(List&lt;String&gt; tags) {
          this.tags = tags;
      }
  
      /**
       * 
       * @return
       *     The videoStillURL
       */
      public String getVideoStillURL() {
          return videoStillURL;
      }
  
      /**
       * 
       * @param videoStillURL
       *     The videoStillURL
       */
      public void setVideoStillURL(String videoStillURL) {
          this.videoStillURL = videoStillURL;
      }
  
      /**
       * 
       * @return
       *     The thumbnailURL
       */
      public String getThumbnailURL() {
          return thumbnailURL;
      }
  
      /**
       * 
       * @param thumbnailURL
       *     The thumbnailURL
       */
      public void setThumbnailURL(String thumbnailURL) {
          this.thumbnailURL = thumbnailURL;
      }
  
      /**
       * 
       * @return
       *     The length
       */
      public int getLength() {
          return length;
      }
  
      /**
       * 
       * @param length
       *     The length
       */
      public void setLength(int length) {
          this.length = length;
      }
  
      /**
       * 
       * @return
       *     The renditions
       */
      public List&lt;Rendition&gt; getRenditions() {
          return renditions;
      }
  
      /**
       * 
       * @param renditions
       *     The renditions
       */
      public void setRenditions(List&lt;Rendition&gt; renditions) {
          this.renditions = renditions;
      }
  
      /**
       * 
       * @return
       *     The IOSRenditions
       */
      public List&lt;IOSRendition&gt; getIOSRenditions() {
          return IOSRenditions;
      }
  
      /**
       * 
       * @param IOSRenditions
       *     The IOSRenditions
       */
      public void setIOSRenditions(List&lt;IOSRendition&gt; IOSRenditions) {
          this.IOSRenditions = IOSRenditions;
      }
  
      /**
       * 
       * @return
       *     The HDSRenditions
       */
      public List&lt;Object&gt; getHDSRenditions() {
          return HDSRenditions;
      }
  
      /**
       * 
       * @param HDSRenditions
       *     The HDSRenditions
       */
      public void setHDSRenditions(List&lt;Object&gt; HDSRenditions) {
          this.HDSRenditions = HDSRenditions;
      }
  
  }
  </code></pre>
  
  <p><strong>UPDATE</strong>: So above you can see that we have defined <code>private List&lt;Rendition&gt; renditions = new ArrayList&lt;Rendition&gt;();</code> that is defined in another pojo classes Rendition.class:</p>
  
  <pre><code>import com.google.gson.annotations.Expose;
  import com.google.gson.annotations.SerializedName;
  
  public class Rendition {
  
      @SerializedName("audioOnly")
      @Expose
      private boolean audioOnly;
      @SerializedName("controllerType")
      @Expose
      private String controllerType;
      @SerializedName("displayName")
      @Expose
      private String displayName;
      @SerializedName("encodingRate")
      @Expose
      private int encodingRate;
      @SerializedName("frameHeight")
      @Expose
      private int frameHeight;
      @SerializedName("frameWidth")
      @Expose
      private int frameWidth;
      @SerializedName("id")
      @Expose
      private int id;
      @SerializedName("referenceId")
      @Expose
      private Object referenceId;
      @SerializedName("remoteStreamName")
      @Expose
      private Object remoteStreamName;
      @SerializedName("remoteUrl")
      @Expose
      private Object remoteUrl;
      @SerializedName("size")
      @Expose
      private int size;
      @SerializedName("uploadTimestampMillis")
      @Expose
      private int uploadTimestampMillis;
      @SerializedName("url")
      @Expose
      private String url;
      @SerializedName("videoCodec")
      @Expose
      private String videoCodec;
      @SerializedName("videoContainer")
      @Expose
      private String videoContainer;
      @SerializedName("videoDuration")
      @Expose
      private int videoDuration;
  
      /**
       * No args constructor for use in serialization
       * 
       */
      public Rendition() {
      }
  
      /**
       * 
       * @param controllerType
       * @param encodingRate
       * @param referenceId
       * @param url
       * @param size
       * @param id
       * @param uploadTimestampMillis
       * @param frameWidth
       * @param remoteUrl
       * @param videoContainer
       * @param remoteStreamName
       * @param displayName
       * @param videoCodec
       * @param videoDuration
       * @param audioOnly
       * @param frameHeight
       */
      public Rendition(boolean audioOnly, String controllerType, String displayName, int encodingRate, int frameHeight, int frameWidth, int id, Object referenceId, Object remoteStreamName, Object remoteUrl, int size, int uploadTimestampMillis, String url, String videoCodec, String videoContainer, int videoDuration) {
          this.audioOnly = audioOnly;
          this.controllerType = controllerType;
          this.displayName = displayName;
          this.encodingRate = encodingRate;
          this.frameHeight = frameHeight;
          this.frameWidth = frameWidth;
          this.id = id;
          this.referenceId = referenceId;
          this.remoteStreamName = remoteStreamName;
          this.remoteUrl = remoteUrl;
          this.size = size;
          this.uploadTimestampMillis = uploadTimestampMillis;
          this.url = url;
          this.videoCodec = videoCodec;
          this.videoContainer = videoContainer;
          this.videoDuration = videoDuration;
      }
  
      /**
       * 
       * @return
       *     The audioOnly
       */
      public boolean isAudioOnly() {
          return audioOnly;
      }
  
      /**
       * 
       * @param audioOnly
       *     The audioOnly
       */
      public void setAudioOnly(boolean audioOnly) {
          this.audioOnly = audioOnly;
      }
  
      /**
       * 
       * @return
       *     The controllerType
       */
      public String getControllerType() {
          return controllerType;
      }
  
      /**
       * 
       * @param controllerType
       *     The controllerType
       */
      public void setControllerType(String controllerType) {
          this.controllerType = controllerType;
      }
  
      /**
       * 
       * @return
       *     The displayName
       */
      public String getDisplayName() {
          return displayName;
      }
  
      /**
       * 
       * @param displayName
       *     The displayName
       */
      public void setDisplayName(String displayName) {
          this.displayName = displayName;
      }
  
      /**
       * 
       * @return
       *     The encodingRate
       */
      public int getEncodingRate() {
          return encodingRate;
      }
  
      /**
       * 
       * @param encodingRate
       *     The encodingRate
       */
      public void setEncodingRate(int encodingRate) {
          this.encodingRate = encodingRate;
      }
  
      /**
       * 
       * @return
       *     The frameHeight
       */
      public int getFrameHeight() {
          return frameHeight;
      }
  
      /**
       * 
       * @param frameHeight
       *     The frameHeight
       */
      public void setFrameHeight(int frameHeight) {
          this.frameHeight = frameHeight;
      }
  
      /**
       * 
       * @return
       *     The frameWidth
       */
      public int getFrameWidth() {
          return frameWidth;
      }
  
      /**
       * 
       * @param frameWidth
       *     The frameWidth
       */
      public void setFrameWidth(int frameWidth) {
          this.frameWidth = frameWidth;
      }
  
      /**
       * 
       * @return
       *     The id
       */
      public int getId() {
          return id;
      }
  
      /**
       * 
       * @param id
       *     The id
       */
      public void setId(int id) {
          this.id = id;
      }
  
      /**
       * 
       * @return
       *     The referenceId
       */
      public Object getReferenceId() {
          return referenceId;
      }
  
      /**
       * 
       * @param referenceId
       *     The referenceId
       */
      public void setReferenceId(Object referenceId) {
          this.referenceId = referenceId;
      }
  
      /**
       * 
       * @return
       *     The remoteStreamName
       */
      public Object getRemoteStreamName() {
          return remoteStreamName;
      }
  
      /**
       * 
       * @param remoteStreamName
       *     The remoteStreamName
       */
      public void setRemoteStreamName(Object remoteStreamName) {
          this.remoteStreamName = remoteStreamName;
      }
  
      /**
       * 
       * @return
       *     The remoteUrl
       */
      public Object getRemoteUrl() {
          return remoteUrl;
      }
  
      /**
       * 
       * @param remoteUrl
       *     The remoteUrl
       */
      public void setRemoteUrl(Object remoteUrl) {
          this.remoteUrl = remoteUrl;
      }
  
      /**
       * 
       * @return
       *     The size
       */
      public int getSize() {
          return size;
      }
  
      /**
       * 
       * @param size
       *     The size
       */
      public void setSize(int size) {
          this.size = size;
      }
  
      /**
       * 
       * @return
       *     The uploadTimestampMillis
       */
      public int getUploadTimestampMillis() {
          return uploadTimestampMillis;
      }
  
      /**
       * 
       * @param uploadTimestampMillis
       *     The uploadTimestampMillis
       */
      public void setUploadTimestampMillis(int uploadTimestampMillis) {
          this.uploadTimestampMillis = uploadTimestampMillis;
      }
  
      /**
       * 
       * @return
       *     The url
       */
      public String getUrl() {
          return url;
      }
  
      /**
       * 
       * @param url
       *     The url
       */
      public void setUrl(String url) {
          this.url = url;
      }
  
      /**
       * 
       * @return
       *     The videoCodec
       */
      public String getVideoCodec() {
          return videoCodec;
      }
  
      /**
       * 
       * @param videoCodec
       *     The videoCodec
       */
      public void setVideoCodec(String videoCodec) {
          this.videoCodec = videoCodec;
      }
  
      /**
       * 
       * @return
       *     The videoContainer
       */
      public String getVideoContainer() {
          return videoContainer;
      }
  
      /**
       * 
       * @param videoContainer
       *     The videoContainer
       */
      public void setVideoContainer(String videoContainer) {
          this.videoContainer = videoContainer;
      }
  
      /**
       * 
       * @return
       *     The videoDuration
       */
      public int getVideoDuration() {
          return videoDuration;
      }
  
      /**
       * 
       * @param videoDuration
       *     The videoDuration
       */
      public void setVideoDuration(int videoDuration) {
          this.videoDuration = videoDuration;
      }
  
  }
  </code></pre>
  
  <p>I have created a retrofit interface VideoInterface.class</p>
  
  <p>import retrofit2.Call;
  import retrofit2.http.GET;</p>
  
  <pre><code>/**
  * retrofit 2 interface
   */
  public interface VideoInterface {
      String apiURL = ".....";
  
      @GET(apiURL)
      public Call&lt;VideosResponse&gt; listVideos();
  }
  </code></pre>
  
  <p>I have created a response/parse class  VideosResponse.java</p>
  
  <pre><code>import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   */
  public class VideosResponse {
  //initalizing the collection
          List&lt;VideoInfo&gt; videos;
  
          public VideosResponse() {
              videos = new ArrayList&lt;VideoInfo&gt;();
          }
  //parsing the response
      public static VideosResponse parseJSON(String response) {
          Gson gson = new GsonBuilder().create();
          VideosResponse videosResponse = gson.fromJson(response, VideosResponse.class);
  
          return videosResponse;
      }
  }
  </code></pre>
  
  <p><strong>UPDATED</strong> :Finally I'm calling the API , but not able to get the individual elements
  I know I should be able to do something like <strong><code>response.body().getItem().getID().getRendition().getUrl()</code></strong> for example, but I don't see it in the auto complete and if I write it I get errors.
  This code is in my <code>onResume()</code> method , the reason why I've commented out <code>public static</code> below is because it's not allowed within the <code>onResume()</code></p>
  
  <pre><code>        // Creating a simple REST adapter which points the API
  
  //        public static
          final String BASE_URL = "http://api......";
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(BASE_URL)
                  .addConverterFactory(GsonConverterFactory.create())
                  .build();
  
          // Creating an instance of our API interface.
  
          VideoInterface service = retrofit.create(VideoInterface.class);
  
          Call&lt;VideosResponse&gt; call = service.listVideos();
          call.enqueue(new Callback&lt;VideosResponse&gt;() {
              @Override
              public void onResponse(Call&lt;VideosResponse&gt; call, Response&lt;VideosResponse&gt; response) {
                  VideosResponse videoResponse = response.body();
  
              }
  
              @Override
              public void onFailure(Call&lt;VideosResponse&gt; call, Throwable t) {
  
              }});
  </code></pre>
  
  <p>Everything to the last step seems be alright (no errors), the following logs gives me:</p>
  
  <pre><code>        Log.d("Videos ", response.message()); //OK
          Log.d("Videos ", String.valueOf(response.isSuccess())); //TRUE
          Log.d("Videos ", String.valueOf(response.code())); //200
  </code></pre>
  
  <p>but I'm still not able to get the strings I need. When I print the log for the response show the response <code>VideosResponse videoResponse = response.body();</code> I get : VideosResponse@3b8bfaa4 , is this normal? how can I use this?
  Is using parcelable advised? will it change anything?</p>