RO FOR JAVASCRIPT can't be used on ANDROIKD?

RO9.1, WEB application can run under browsers under the WINDOWS platform. It doesn’t work on Android browser. Binmessage or jsonmessage connection is not good. Is there any way to solve it?

Could you provide more details like a testcase, Android/Browser version used etc?

Hi,
I was about to ask for a similar problem I think.

My case:
In Smart Mobile Studio, I make a call to a RO JSON Service.

procedure TForm1.W3Button1Click(Sender: TObject);
begin
serveur.GetActors(
procedure (aResult: TTabActor) begin
for var elem in aResult.items do begin
cbActor.Add(elem.act_nom);
end;
end,
procedure (aMessage: TROMessage; aError: JError) begin
lbMessage.Caption := aError.name + ’ → ’ + aError.message;
end
);
end;

(TTabActor is an array of struct TActor defined in Service Builder).

This code works fine in the embedded browser and in any external browser, but not on mobile.
Androit 5.1 / Chrome.

  • aError is undefined
  • aMessage is

{“fClientID”:“27a9cbfa-d3af-4dd5-acd7-0fa0e0b5bfd4”,
“fRequestObject”:{
“id”:“{27a9cbfa-d3af-4dd5-acd7-0fa0e0b5bfd4}”,
“method”:“CheckService.GetActors”,“params”:{}},
“fResponseObject”:{“error”:{“message”:"AJAX status: 0\nResponse: "}}}

Could you provide a complette testcase?

Well, I’m trying to set up a test case, but I’m stucked with a problem with desktop JSON client.
Project attached (Delphi XE5)
_test_RO_JSON.zip (1.4 MB)

Which exactly issue do you have with the desktop client app?

Please make sure that the WrapResults property of JSON Message has the same value in both server and client. Actually you need to set WrapResults to true on the server side. In this case it will also match the setting value that is used by the JavaScript client by default.

Ok for WrapResult, although this doesn’t solve my issue.

BIN messaging works fine.

But selecting JSON
EReadError: Flux read error
in UROSONParser.pas - ReadNextChar

JSON_v2.zip (1.4 MB)

You are trying to pass JSON client request to BIN message on server-side

Add this event:

procedure TClientForm.RadioGroup1Click(Sender: TObject);
begin
  case RadioGroup1.ItemIndex of
     0:ROChannel.TargetUrl := 'http://127.0.0.1:8099/bin';
     1:ROChannel.TargetUrl := 'http://127.0.0.1:8099/json';
  end;
end;

and everything will work.

Ok, then here is my test case with:

  • RO server (BIN/JSON)
  • ROClient (BIN/JSON) working fine
  • SMS JSON Client
    It works fine on desktop browsers, but not on Android (4.4.4 or 5.1)
    TypeError: Cannot read property ‘name’ of undefined

JSON_v3.zip (1.6 MB)

Thanks, logged as bugs://79271

1 Like

Your testcase works as expected after a minor change:

In this code

var ROChannel := TROHTTPClientChannel.Create('http://127.0.0.1:8099/json');
var ROMessage := TROJSONMessage.Create;

you shoud use proper server address or hostname. When run on a mobile device or a remote computer 127.0.0.1 will point on a local host or device, not on the server application.

1 Like

oh yes !
Thank you !