Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is in the base object. It should not be Programs but another object that has a Programs attribute. Apart from that, the Programs object has an array of Program as attribute, not a single instance.</p> <p>Base object:</p> <pre><code>public class JsonRootObject { public Programs programs; } </code></pre> <p>Programs object:</p> <pre><code>public class Programs implements Serializable { private static final long serialVersionUID = 1L; public Program []program; } </code></pre> <p>Program object:</p> <pre><code>public class Program implements Serializable { private static final long serialVersionUID = 1L; public Episode[] episode; } </code></pre> <p>Episode object:</p> <pre><code>public class Episode implements Serializable { private static final long serialVersionUID = 1L; public String pN, episodeNumber, transmissionName, date, time, channel, channelLogo; @Override public String toString() { return "Episode [pN=" + pN + ", episodeNumber=" + episodeNumber + ", transmissionName=" + transmissionName + ", date=" + date + ", time=" + time + ", channel=" + channel + ", channelLogo=" + channelLogo + "]"; } } </code></pre> <p>EpisodeData is not needed, as Episode is the last level.</p> <p>And finally you can parse it with:</p> <pre><code>Gson decoder = new Gson(); JsonRootObject programs = decoder.fromJson(json, JsonRootObject.class); </code></pre> <p>I added a toString method to Episode class to test the parser, and this is the result:</p> <pre><code>System.out.println(programs.programs.program[0].episode[0]); 08-06 05:31:58.236: I/System.out(1249): Episode [pN=1, episodeNumber=1, transmissionName=Titolo, date=29 Giu 2013, time=14:30, channel=Real Time, channelLogo=https://lh6.googleusercontent.com/-XSh-9ngYJu4/ThiY-xl2EeI/AAAAAAAABmc/iz04VpL5hOs/s800/realtime.png] </code></pre> <p>Hope that helps :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload