这里写了两种解析方法
package com.example.activity;
第二种方法
第二种方法,需要借住实体类
一下提供了接口,和相应的数据
public void click1(View v){}
实体类
package com.example.activity;
import java.util.List;
public class Group {
private String rows;
private String info;
private String code;
private List<Data> data;
public String getRows() {
return rows;
}
public void setRows(String rows) {
this.rows = rows;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public List<Data> getData() {
return data;
}
public void setData(List<Data> data) {
this.data = data;
}
}
实体类
package com.example.activity;
public class Data {
private String expect;
private String opencode;
private String opentime;
private String opentimestamp;
public String getExpect() {
return expect;
}
public void setExpect(String expect) {
this.expect = expect;
}
public String getOpencode() {
return opencode;
}
public void setOpencode(String opencode) {
this.opencode = opencode;
}
public String getOpentime() {
return opentime;
}
public void setOpentime(String opentime) {
this.opentime = opentime;
}
public String getOpentimestamp() {
return opentimestamp;
}
public void setOpentimestamp(String opentimestamp) {
this.opentimestamp = opentimestamp;
}
}
2015.1.9,第六次课Android对服务端数据进行json解析
原文地址:http://blog.csdn.net/jsmen_lbg/article/details/42561853