title: Parsing JSON with retrofit-gson?
body: <p>I am trying to work with retrofit to parse the json data but there is no data received help me to parse the data.</p>
  
  <p>Below is the builder and interface i created :</p>
  
  <pre><code>public class fetchdata {
      private static UserFetchData userdatafetch = null;
  
      public static UserFetchData getService() {
          if (userdatafetch==null) {
              String url = "the_instagram_link";
              Retrofit retrofit = new Retrofit.Builder()
                      .baseUrl(url)
                      .addConverterFactory(GsonConverterFactory.create())
                      .build();
  
              userdatafetch = retrofit.create(UserFetchData.class);
          }
          return userdatafetch;
      }
  
      public interface UserFetchData {
          @GET("full_name")
          Call&lt;User&gt; getFullName();
      }
  }
  </code></pre>
  
  <p>Below is <code>jsonschema2pojo</code> files to be used in app :</p>
  
  <pre><code>-----------------------------------com.google.app.HdProfilePicUrlInfo.java-----------------------------------
  
  package com.google.app;
  
  import com.google.gson.annotations.Expose;
  import com.google.gson.annotations.SerializedName;
  
  public class HdProfilePicUrlInfo {
  
  @SerializedName("height")
  @Expose
  private Integer height;
  @SerializedName("url")
  @Expose
  private String url;
  @SerializedName("width")
  @Expose
  private Integer width;
  
  public Integer getHeight() {
  return height;
  }
  
  public void setHeight(Integer height) {
  this.height = height;
  }
  
  public String getUrl() {
  return url;
  }
  
  public void setUrl(String url) {
  this.url = url;
  }
  
  public Integer getWidth() {
  return width;
  }
  
  public void setWidth(Integer width) {
  this.width = width;
  }
  
  }
  -----------------------------------com.google.app.User.java-----------------------------------
  
  package com.google.app;
  
  import com.google.gson.annotations.Expose;
  import com.google.gson.annotations.SerializedName;
  
  public class User {
  
  @SerializedName("is_verified")
  @Expose
  private Boolean isVerified;
  @SerializedName("biography")
  @Expose
  private String biography;
  @SerializedName("follower_count")
  @Expose
  private Integer followerCount;
  @SerializedName("media_count")
  @Expose
  private Integer mediaCount;
  @SerializedName("hd_profile_pic_url_info")
  @Expose
  private HdProfilePicUrlInfo hdProfilePicUrlInfo;
  @SerializedName("external_lynx_url")
  @Expose
  private String externalLynxUrl;
  @SerializedName("following_count")
  @Expose
  private Integer followingCount;
  
  public Boolean getIsVerified() {
  return isVerified;
  }
  
  public void setIsVerified(Boolean isVerified) {
  this.isVerified = isVerified;
  }
  
  public String getBiography() {
  return biography;
  }
  
  public void setBiography(String biography) {
  this.biography = biography;
  }
  
  public Integer getFollowerCount() {
  return followerCount;
  }
  
  public void setFollowerCount(Integer followerCount) {
  this.followerCount = followerCount;
  }
  
  public Integer getMediaCount() {
  return mediaCount;
  }
  
  public void setMediaCount(Integer mediaCount) {
  this.mediaCount = mediaCount;
  }
  
  public HdProfilePicUrlInfo getHdProfilePicUrlInfo() {
  return hdProfilePicUrlInfo;
  }
  
  public void setHdProfilePicUrlInfo(HdProfilePicUrlInfo hdProfilePicUrlInfo) {
  this.hdProfilePicUrlInfo = hdProfilePicUrlInfo;
  }
  
  public String getExternalLynxUrl() {
  return externalLynxUrl;
  }
  
  public void setExternalLynxUrl(String externalLynxUrl) {
  this.externalLynxUrl = externalLynxUrl;
  }
  
  public Integer getFollowingCount() {
  return followingCount;
  }
  
  public void setFollowingCount(Integer followingCount) {
  this.followingCount = followingCount;
  }
  
  }
  -----------------------------------com.google.app.Userdata.java-----------------------------------
  
  package com.google.app;
  
  import com.google.gson.annotations.Expose;
  import com.google.gson.annotations.SerializedName;
  
  public class Userdata {
  
  @SerializedName("user")
  @Expose
  private User user;
  
  public User getUser() {
  return user;
  }
  
  public void setUser(User user) {
  this.user = user;
  }
  
  } 
  </code></pre>
  
  <p>and this is how i tried to get the data :</p>
  
  <pre><code>public void GetData {
          Call&lt;User&gt; jsondata = fetchdata.getService().getFullName();
          jsondata.enqueue(new Callback&lt;User&gt;() {
              @Override
              public void onResponse(Call&lt;User&gt; call, Response&lt;User&gt; response) {
                  User user = response.body();
                  Toast.makeText(getContext(), "Yeeeeep !", Toast.LENGTH_SHORT).show();//added the break point but no data recived but it toasted
              }
  
              @Override
              public void onFailure(Call&lt;User&gt; call, Throwable t) {
                  Toast.makeText(getContext(), "Error!", Toast.LENGTH_SHORT).show();
              }
          });
  
      } 
  </code></pre>
  
  <p>Glide dependencies :</p>
  
  <p><code>implementation 'com.squareup.retrofit2:retrofit:2.4.0'</code></p>
  
  <p><code>implementation 'com.squareup.retrofit2:converter-gson:2.4.0'</code></p>
  
  <p>I really don't know what i am doing wrong and how to solve it.
  I really want to know how to parse the json.</p>
  
  <p>Thank you.</p>
  
  <p><strong>EDIT</strong>
  This is the responce i will recieve from the server :</p>
  
  <pre><code>{
    "user": {
      "external_lynx_url": "https://l.instagram.com/?u=http%3A%2F%2Fgoogle.com%2F\u0026e=ATPCIx1ldIEQpnqvlYYf-W9bvjDwTqw4XGRSCjt5mr5VhqwlaEsaHpdkMUiU2BfQumhKNM3IJEQri5UX8Qsz8p2G",
      "username": "google",
      "has_anonymous_profile_picture": false,
      "external_url": "http://google.com/",
      "full_name": "Google",
      "profile_pic_id": "1825015012270132630_1067259270",
      "media_count": 830,
      "pk": 1067259270,
      "hd_profile_pic_versions": [
        {
          "height": 320,
          "url": "https://instagram.fjai1-1.fna.fbcdn.net/vp/1df66b7b71efa2a6dba025f38a47495a/5BE04111/t51.2885-19/s320x320/36616551_641374529567850_6798278096731504640_n.jpg",
          "width": 320
        },
        {
          "height": 640,
          "url": "https://instagram.fjai1-1.fna.fbcdn.net/vp/e453300e2a8170426349c370afe2c8f7/5BD45B7E/t51.2885-19/s640x640/36616551_641374529567850_6798278096731504640_n.jpg",
          "width": 640
        }
      ],
      "is_private": false,
      "is_verified": true,
      "reel_auto_archive": "on",
      "biography": "Google unfiltered\u2014sometimes with filters.",
      "follower_count": 7035887,
      "has_highlight_reels": true,
      "usertags_count": 311,
      "following_count": 12,
      "profile_pic_url": "https://instagram.fjai1-1.fna.fbcdn.net/vp/e4e4a1a1c41950738442218cf892669e/5C0D19E1/t51.2885-19/s150x150/36616551_641374529567850_6798278096731504640_n.jpg",
      "hd_profile_pic_url_info": {
        "height": 1080,
        "url": "https://instagram.fjai1-1.fna.fbcdn.net/vp/10891608f8e9f072ac5dcb4e9554b7a6/5BE33A1B/t51.2885-19/36616551_641374529567850_6798278096731504640_n.jpg",
        "width": 1080
      },
      "auto_expand_chaining": false
    },
    "status": "ok"
  } 
  </code></pre>