You need to first create the methods of Datasnap for Android and put in your application, example:
C:\Win32ProxyDownloader.exe -language java_android -host 127.0.0.1:8080 -output C:\test
Then you create a class with a Datasnap connection to connect to the server:
DSRESTConnection conn = new DSRESTConnection();
conn.setHost("host");
conn.setPort(port);
conn.setProtocol("http");
And to recover the data:
TServerMethods1 proxy = new TServerMethods1(conn);
VarParamTestReturns Result = proxy.VarParamTest("Hello, World!");
System.out.println(Result.Value);
System.out.println(Result.returnValue);
This being the method created in the server-side Datasnap application generally declared in the file DServerMethods.pas of the application:
function TServerMethods1.VarParamTest(var Value: string): string;
begin
Value := StrUtils.ReverseString(Value);
Result := Value;
end;
References:
Developing Datasnap Applications
Getting Started with Java Android Datasnap Mobile Connector