You must first create the methods of Datasnap for Android and put in your application, for 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 data:
TServerMethods1 proxy = new TServerMethods1(conn);
VarParamTestReturns Result = proxy.VarParamTest("Hello, World!");
System.out.println(Result.Value);
System.out.println(Result.returnValue);
This is the method created in the server-side DataSnap application that is usually declared in the application DServerMethods.pas
file:
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