You can paste your json String to http://www.jsonschema2pojo.org/
it will create object of jsonString.
Example with your json:
-----------------------------------com.example.Datum.java-----------------------------------
package com.example;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Datum {
@SerializedName("address")
@Expose
private String address;
@SerializedName("balance")
@Expose
private Integer balance;
@SerializedName("nonce")
@Expose
private Object nonce;
@SerializedName("code")
@Expose
private String code;
@SerializedName("name")
@Expose
private Object name;
@SerializedName("storage")
@Expose
private Object storage;
@SerializedName("firstSeen")
@Expose
private String firstSeen;
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Integer getBalance() {
return balance;
}
public void setBalance(Integer balance) {
this.balance = balance;
}
public Object getNonce() {
return nonce;
}
public void setNonce(Object nonce) {
this.nonce = nonce;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Object getName() {
return name;
}
public void setName(Object name) {
this.name = name;
}
public Object getStorage() {
return storage;
}
public void setStorage(Object storage) {
this.storage = storage;
}
public String getFirstSeen() {
return firstSeen;
}
public void setFirstSeen(String firstSeen) {
this.firstSeen = firstSeen;
}
}
-----------------------------------com.example.Example.java-----------------------------------
package com.example;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Example {
@SerializedName("status")
@Expose
private Integer status;
@SerializedName("data")
@Expose
private List<Datum> data = null;
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public List<Datum> getData() {
return data;
}
public void setData(List<Datum> data) {
this.data = data;
}
}
After you will get object from jsonString with function:
// Deserialize to single object.
public Example deserializeFromJson(String jsonString) {
Gson gson = new Gson();
Example myClass = gson.fromJson(jsonString, Example.class);
return myClass;
}
And you can get everything in your object.
I hope it can help your problem!