0
Good afternoon. I would like to know how I can extract the data received by the server using Datasnap from Delphi. I’m doing it this way, 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 version_list variable receives this value from dsProxy.getVerses():
["{\"type\":\"ClassesProjeto.TVersao\",\"id\":1,\"fields\":{\"FVersao\":1,\"FData_inc\":42230,\"FHora_inc\":0.904861111111111}}"]
Error:
java.lang.Classcastexception: com.embarcadero.javaandroid.Tjsonstring cannot 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)