Good afternoon. I would like to know how I can extract the data received by the server using Delphi's DataSnap. I'm doing this, but it's returning an error:
lista_versoes = dsProxy.getVersoes();
TJSONObject json_versao = new TJSONObject();
for (int i=0; i < lista_versoes.size(); i++){
json_versao = lista_versoes.getAsJsonObject(i);
String versao = json_versao.getString("FVersao");
}
The variable lista_versoes receives this value from dsProxy.getVersoes ():
["{\"type\":\"ClassesProjeto.TVersao\",\"id\":1,\"fields\":{\"FVersao\":1,\"FData_inc\":42230,\"FHora_inc\":0.904861111111111}}"]
Error:
java.lang.ClassCastException: com.embarcadero.javaandroid.TJSONString can not be cast to com.embarcadero.javaandroid.TJSONObject at com.embarcadero.javaandroid.TJSONArray.getJSONObject (TJSONArray.java:220) at com.nutricionista.tela.TelaLogin $ 4.run (TelaLogin.java:205)