android - Retrofit XML Response? -


how should create classes kind of xml response?

<delivery_zones>             <zone>3</zone>             <zone_name>....</zone_name>             <zone>10</zone>             <zone_name>....</zone_name>             <zone>7</zone>             <zone_name>....</zone_name>             <zone>9</zone>             <zone_name>....</zone_name>             <zone>13</zone>             <zone_name>....</zone_name> </delivery_zones> 

thank you..

write class

class zone {    int id;    string name;     public(int id, string name) {        this.id = id;        this.name = name;    } } 

create list of zone objects. parse response , create object zone class each zone , add list if not contain zone.

i think might you. if need more info xml parsing. link https://stackoverflow.com/a/5059411/7867325 helps you.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -