#1 2016-07-10 05:42:22

Peter Evans
Member
Registered: 2016-07-03
Posts: 32

Sample 27 Cross Platform Clients - my experiences

There are a number of projects in Sample 27. This is my experience with them.

I am using Delphi 10.1 Berlin.

a) Project 'MobileClient.dpr'.

In MobileMain.pas need to comment out the line 51 :-
    assert(json = ...

Then the program works on Android machine - Google Nexus 7.
Does not need a server to work.

b) Project 'FMClient.dpr'.

In FMMain.pas need to comment out the line 101 :-
   assert(json = ...

On Android machine - Google Nexus 7. When run get an
   EOpenError 'Cannot open file "/people.json".

I changed the name of the file from 'People.json' to 'people.json'. Then added
the file to the Deployment tab. (On Deployment tab I made the Remote Path = .\
I got the same error.


I then amended the code to read :-

USES
  System.IOUtils;

  {
  FN := 'people.json';
  for level := 1 to 4 do
    if FileExists(FN) then
      break else
      FN := IncludeTrailingPathDelimiter('..')+FN;
  }
  FN := TPath.GetDocumentsPath + PathDelim + 'people.json';


When run I get an error in function UTF8FileToString in unit
SynCrossPlatformJSON. The function is unable to find the file.

I am not sure why this is so.

c) Project14ServerHttpWrapper  [in this Sample 27]

To get this to work I had to place the files from
CrossPlatform/templates in the following hierarchy :-

    Folder For My Project\Project14ServerHttpWrapper
    CrossPlatform\template\copied files

Regards,
  Peter Evans

Offline

Board footer

Powered by FluxBB