22 responses

  1. Michael Justin
    January 11, 2012

    COUNTRIES.add(reader.getValue(“COUNTRY”).GetAsString()) looks a little overcomplicated when compared with typical JDBC result set processing in Java. Maybe a future version of DataSnap will allow more intuitive code like reader.getString(“field”) … ?

    • Andreano Lanusse
      January 11, 2012

      Michael,

      The proxy in Java is matching the same structure we use in Delphi for dbExpress Framework.

  2. Omar Zelaya
    January 17, 2012

    Hi,

    I’m doing some tests on Android to call a DataSnap server method that
    returns a simple class.

    Delphi Side:
    TPrueba = class
    private
    FUnString : string;
    public
    published
    property UnString : string read FUnString write FUnString;
    end;

    Java Side:

    private class TPrueba {
    public String UnString;

    }

    With the following Datasnap server method:

    function RetornaEstructura(Value : string) : TPrueba;

    When I generate the java.android proxy the method returns a TJSONObject.

    1. Is the Java class definition ok to match the Delphi one and be able parse
    it?
    2. I have tried using the Google.GSon library to parse the TJSONObject with
    no success. it is possible?
    I get a empty Prueba when I call Prueba = g.fromJson(JSonObj.toString(),
    Prueba.getClass()); or am I doing it wrong?
    3. Is there another way to parse the TJSONObject and load into the
    TPrueba Java class?

    Thanks in advance,

    Omar Zelaya

  3. statik0
    April 11, 2012

    Hi, I need to develop an Android application that connects to an Delphi application using a web service . Some ideas ?? Help me please !!!

    • Andreano Lanusse
      April 13, 2012

      @Statik0,

      You just need to import the WSDL on the Android side, google and you will find a lot of videos.

  4. Khan
    April 25, 2012

    Where can I download this sample source code on Delphi and Java.

    Thank you.

  5. Anagnostes
    May 2, 2012

    What should be the setHost and setPort of the getConnection() funcion when you deploy the WebService as isapi dll?

    I get “Host may not be null” all the time.

    Thank you

    • Andreano Lanusse
      May 2, 2012

      setHost should be IP or hostname of the machine running the DataSnap Server and port should be 8080, unless you changed the default

      • Anagnostes
        May 2, 2012

        With a dll in an IIS server with the 8080? I thought the port was 80 as HTTP in IIS.

        With IP and port 8080 doesn’t work. I compile the dll, put it in a server with other ISAPIs and no way i can’t get a connection in Java.

        with http://192.168.2.5/TestRest.dll i get the default DataSnap REST Project webpage.

        I don’t know if i’m doing something wrong.

        Thank you very much… that’s a record time answer!

  6. Andreano Lanusse
    May 2, 2012

    In IIS will be port 80 by default and try to call some server method, just http://192.168.2.5/TestRest.dll won’t do anything

    • Anagnostes
      May 2, 2012

      Finnally got it:

      conn.setHost(“192.168.2.5″);
      conn.setPort(80);
      conn.setUrlPath(“/TestRest.dll”);

      Thanks

  7. Remmie Ran
    October 16, 2012

    Hi,
    I followed your example to connect to datasnap and create an android app but it is not working on the android side. for some reason I does not post back to the table or refresh the data. It does work if i use a web page but not from eclipse. any Ideas?

    • Andreano Lanusse
      October 16, 2012

      @Remmie I’m not understanding what is the problem, can you please clarify.

      • Remmie Ran
        October 18, 2012

        Andreano, I think is the eclipse system on my PC It just will not “talk” with the REST Server for some reason. calling the same address from a web browser works. but not from the Android emulator. I am trying to do the same in RADPHP and having problems with the DBXReader. I do not know how to access it. ??

      • Remmie Ran
        October 18, 2012

        got it thanks.

  8. giovanni
    October 22, 2012

    in the first example InsertCountry ther is Comm.Free,
    in the second example GetCountries no. Why ?

    Thanks

    • Andreano Lanusse
      October 24, 2012

      Giovanni, because on the second one I return the cursor through the TDBXReader, as the server finish to send the cursor to the client side it will be automatically destroyed by the server.

  9. Sergio Kawahara
    November 8, 2012

    Andreano, primeiramente quero parabeniza-los pelos post, muito util para a comunidade, gostaria de saber como posso fazer para compartilhar a function getConnection() com outras class, sem a precisar refazer a function em cada class, fazendo apenas a chamada, já tentei assim:
    ClassConexao Conexao = new ClassConexao();
    DSRestConnection conn = Conexao.getConnection();
    Mas não funciona, se puder ajudar fico muito grato

    Sergio Kawahara

  10. dison
    May 17, 2013

    Hello Lanusse im getting a error “incorrect type in dbxvalue” if the table has a field of data type integer

    when i call in my code
    COUNTRIES.add(reader.getValue(“ID”).GetAsInt16());

    if i call using
    COUNTRIES.add(reader.getValue(“ID”).GetAsString()); i have the same error

    How fill my adapter with a field with data type int in my table

    Thanks

  11. João Carlos
    June 12, 2013

    Andreano, gostaria de parabenizá-lo pelo excelente tutorial.
    Estou começando a desenvolver em Android agora e já consegui implementar o codigo sem problemas na API 10 (Android 2.3.3), infelizmente não consego em nenhume API lançada após a 10. Já quebrei a cabeça bastante mas não encontro solução. Gostaria de lhe pedir uma ajuda para esse caso. Fico muito grato.

    Obrigado

  12. Clederson
    July 2, 2014

    você tem essa aula em Português?

  13. Jorge López
    August 19, 2014

    Hi! Nice job on this tutorial!
    I understood all the guidelines but how can i aproach the access to datasnap server without that proxy libraries? I mean, using tipical url queryng using json as output format?

Leave a Reply

 

 

 

Back to top
mobile desktop