title: Returning null response from Retrofit in Android
body: <p>Am new to Retrofit and API Integration. Am trying to display response in a toast. Am using Retrofit for an API call. But the response from Retrofit is showing null . There is no response instead null. I don't Know may be am doing in a wrong way. Here is my code. Please Help me</p>
  <p>Below is sample API</p>
  <pre><code>Params:
  {
    &quot;DeviceID&quot;: &quot;Hawqr-jagadish-test-device&quot;,
    &quot;DeviceType&quot;: &quot;1&quot;,
    &quot;DeviceName&quot;: &quot;Jagadish Device&quot;,
    &quot;AppVersion&quot;: 1
  }
  Response:
  {
    &quot;success&quot;: true,
    &quot;extras&quot;: {
      &quot;Status&quot;: &quot;Device Splash Screen Completed Successfully&quot;,
      &quot;Env_Type&quot;: 2,
      &quot;ApiKey&quot;: &quot;4ae3a7e5-2622-4376-bc0d-a0ccd6c0405a&quot;,
      &quot;Whether_Latest_Version&quot;: true,
      &quot;SocketIO_Data&quot;: {
        &quot;socket_host&quot;: &quot;https://xsocket.hawqr.com&quot;,
        &quot;socketjs_link&quot;: &quot;https://xsocket.hawqr.com/socket.io/socket.io.js&quot;
      }
    }
  }
  </code></pre>
  <p>This My Main Activity. In main activity i have call API</p>
  <pre><code>      @Override
              protected void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.activity_main);
          
                  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
          
                  new Handler().postDelayed(new Runnable() {
                      @Override
                      public void run() {
                          Intent intent = new Intent(MainActivity.this,LoginActivity.class);
                          startActivity(intent);
                          finish();
                      }
                  },SPLASH_SCREEN );
          
           String DeviceID = &quot;Hawqr-jagadish-test-device&quot;;
                  String DeviceType = &quot;1&quot;;
                  String DeviceName = &quot;Jagadish Device&quot;;
                  Integer AppVersion =  1 ;
          
           SplashRequest splashRequest = new SplashRequest();
                  splashRequest.setDeviceID(DeviceID);
                  splashRequest.setDeviceType(DeviceType);
                  splashRequest.setDeviceName(DeviceName);
                  splashRequest.setAppVersion(AppVersion);
          
          
                  SplashScreen(splashRequest);
           }
   public void SplashScreen(SplashRequest splashRequest){
  
          UserService userService = ApiClient.getRetrofit().create(UserService.class);
  
          Call&lt;SplashResponse&gt; splashResponseCall = userService.splashScreen(splashRequest);
  
          splashResponseCall.enqueue(new Callback&lt;SplashResponse&gt;() {
              @Override
              public void onResponse(Call&lt;SplashResponse&gt; call, Response&lt;SplashResponse&gt; response) {
  
                  Gson gson = new Gson();
                  String successResponse = gson.toJson(response.body());
  
                  Toast.makeText(MainActivity.this,successResponse,Toast.LENGTH_LONG).show();
  
              }
  
              @Override
              public void onFailure(Call&lt;SplashResponse&gt; call, Throwable t) {
   
               String msg = t.getLocalizedMessage();
              Toast.makeText(MainActivity.this,msg,Toast.LENGTH_SHORT).show();
  
              }
          });
      }
  }
  </code></pre>
  <p>These are my Model classes for Parameters</p>
  <pre><code> public class SplashRequest {
          public String DeviceID;
          public String DeviceType;
          public String DeviceName;
          public Integer AppVersion;
      
          public String getDeviceID() {
              return DeviceID;
          }
      
          public void setDeviceID(String deviceID) {
              DeviceID = deviceID;
          }
      
          public String getDeviceType() {
              return DeviceType;
          }
      
          public void setDeviceType(String deviceType) {
              DeviceType = deviceType;
          }
      
          public String getDeviceName() {
              return DeviceName;
          }
      
          public void setDeviceName(String deviceName) {
              DeviceName = deviceName;
          }
      
          public Integer getAppVersion() {
              return AppVersion;
          }
      
          public void setAppVersion(Integer appVersion) {
              AppVersion = appVersion;
          }
  </code></pre>
  <p>Another Model Class</p>
  <pre><code> public String ApiKey;
      public String Env_Type;
      public String Status;
      public String Whether_Latest_Version;
  
      public SplashResponse(String apiKey, String env_Type, String status, String whether_Latest_Version) {
          ApiKey = apiKey;
          Env_Type = env_Type;
          Status = status;
          Whether_Latest_Version = whether_Latest_Version;
      }
  
  
  
      public String getApiKey() {
          return ApiKey;
      }
  
      public void setApiKey(String apiKey) {
          ApiKey = apiKey;
      }
  
      public String getEnv_Type() {
          return Env_Type;
      }
  
      public void setEnv_Type(String env_Type) {
          Env_Type = env_Type;
      }
  
      public String getStatus() {
          return Status;
      }
  
      public void setStatus(String status) {
          Status = status;
      }
  
      public String getWhether_Latest_Version() {
          return Whether_Latest_Version;
      }
  
      public void setWhether_Latest_Version(String whether_Latest_Version) {
          Whether_Latest_Version = whether_Latest_Version;
      }
  }
  </code></pre>
  <p>This My Interface Class for Splash Response and Request</p>
  <pre><code> @POST(&quot;authenticate/&quot;)
      Call&lt;SplashResponse&gt; splashScreen(@Body SplashRequest splashRequest);
  </code></pre>