Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.64 KB | None | 0 0
  1. // пример запроса
  2. http://fe-ct.svc.iptv.rt.ru/smarttube/master/spine/services/json/ott/get_network_config?uid=123321
  3.  
  4. // response класс для него
  5. public class NetworkConfigRs extends Rs {
  6.  
  7.     public static class Url {
  8.         @SerializedName("url")
  9.         public String url;
  10.     }
  11.  
  12.     public static class Data {
  13.         @SerializedName("frontend")
  14.         public Url frontend;
  15.         @SerializedName("proxy")
  16.         public Url proxy;
  17.         @SerializedName("deviceType")
  18.         public String deviceType;
  19.         @SerializedName("homeMrf")
  20.         public String homeMrf;
  21.         @SerializedName("curMrf")
  22.         public String curMrf;
  23.         @SerializedName("curLocation")
  24.         public String curLocation;
  25.         @SerializedName("curSubLocation")
  26.         public String curSubLocation;
  27.  
  28.         @Override
  29.         public String toString() {
  30.             return "Data{" +
  31.                     "frontend=" + frontend +
  32.                     ", proxy=" + proxy +
  33.                     ", deviceType='" + deviceType + '\'' +
  34.                     ", homeMrf='" + homeMrf + '\'' +
  35.                     ", curMrf='" + curMrf + '\'' +
  36.                     ", curLocation='" + curLocation + '\'' +
  37.                     ", curSubLocation='" + curSubLocation + '\'' +
  38.                     '}';
  39.         }
  40.     }
  41.  
  42.     public static class Rows {
  43.         public Data[] data;
  44.     }
  45.  
  46.     @SerializedName("rows")
  47.     public Rows rows;
  48.  
  49. }
  50.  
  51.  // использование этого класса
  52.     NetworkConfigRs rs = methodsServerSDP.getNetworkConfig("123321", null);
  53.     String url = rs.rows.data[0].frontend.url;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement