I created an API to receive database data via json for my android application, but some columns in my table are null, generating an empty json argument that is generating error in my application, I would like to find out the best way to treat this information since it is important to know whether or not the variable is empty.
ex:
Json: "redes_sociais":{"id":1,"telefone":"99999","whatsapp":"99999","facebook":"face","instagram":"","twiter":"","youtube":"","email":""}
Construtor da entidade no android:
public RedesItem(JSONObject rede) throws JSONException {
this.id = rede.getLong("id");
this.telefone = rede.getString("telefone");
this.whatsapp = rede.getString("whatsapp");
this.face = rede.getString("face");
this.insta = rede.getString("insta");
this.twiter = rede.getString("twiter");
this.youtube = rede.getString("youtube");
this.email = rede.getString("email");
}