- Android端接收服务端端传来的Json数据,数据格式如下图所示:
注:要接收的Json数据是字典形式,要注意的Android端创建的相应的Bean中的toString()方法返回的字符创一定要和服务端发送的Json数据格式相同。
Android端接收数据的Bean类,
public class LoginBean { private boolean success; private String message; private Long code; private Long timestamp; private Result result; public boolean isSuccess() { return success; } public void setSuccess(boolean success) { this.success = success; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Long getCode() { return code; } public void setCode(Long code) { this.code = code; } public Long getTimestamp() { return timestamp; } public void setTimestamp(Long timestamp) { this.timestamp = timestamp; } public Result getResult() { return result; } public void setResult(Result result) { this.result = result; }