2

I'm a new in mORMot. I made a mormot server and FMX client. It works on Win mode. Next I changed destination to Android and get an error.

[DCC Fatal Error] SynCrtSock.pas(253): F2613 Unit 'Contnrs' not found (unit SynCrtSock;).

{$R *.fmx}
{$R *.LgXhdpiTb.fmx ANDROID}

function Client(const SQL: RawUTF8): RawUTF8;
var 
  Http: THttpClientSocket;
  URI: AnsiString;
begin
  if ParamCount<>0 then
    URI := AnsiString(ParamStr(1)) 
  else
    URI := '192.168.1.20';
  Http := OpenHttp(URI,'888');
  if Http <> nil then
    try
      Http.Post('root',SQL,TEXT_CONTENT_TYPE);
      result := Http.Content;
    finally
      Http.Free;
    end 
  else
    result := '';
end;


procedure TForm3.TMSFMXButton1Click(Sender: TObject);
begin
  ds1.DataSet := JSONToClientDataSet(self,Client('select * from Lists'));
end;

It works good for Win but doesn't work for Android.

How to make demo for iOS and Android?

Arnaud Bouchez
  • 42,305
  • 3
  • 71
  • 159
Andy Birtman
  • 155
  • 1
  • 9

1 Answers1

6

As stated by the documentation, current version of the main framework units target only Win32 / Win64 systems under Delphi, and (in a preliminary state) Windows or Linux under FPC. So you can run a Server on those platforms.

But you can write a Client on all Delphi supported platforms, by using some dedicated cross-platform client units, and generate some code to consume the server ORM and SOA content.

To write an OSX or Mobile client, using FMX for the UI, do not use regular SynCommons.pas mORMot.pas units, but the dedicated units as available in the CrossPlatform sub-folder.

The documentation is pretty detailed about it.

See also this sample and the associated generated client unit.

Arnaud Bouchez
  • 42,305
  • 3
  • 71
  • 159
  • Mormot's documentation too big. I read demo with calculator but it's calculator. Where is normal mobile demo with DB client? – Andy Birtman Sep 10 '15 at 13:00
  • @AndyBirtman You do not need to read the whole pdf, of course. Did you read the chapter I quote in my answer? Publish the wrappers generator on the server, compute your cross-platform client unit, then use it directly. For RAD consumption, you would have to fill a TDataSet with the data by code, or fill a string grid or other components with code, from the objects returned by the client unit. – Arnaud Bouchez Sep 10 '15 at 13:51
  • 3
    Damned if you do, damned if you don't. "There's not enough documentation." "There's too much documentation." – David Heffernan Sep 10 '15 at 15:28
  • @Arnaud. It's interesting components but I don't understand. General advantages of Delphi is mobile developing. Main advantages of you tools is powerful data access. Why I can't open demo with multi-tier server and mobile client? – Andy Birtman Sep 10 '15 at 16:10
  • and JSONToClientDataSet component is included in mORMotMidasVCL – Andy Birtman Sep 10 '15 at 18:14
  • Hi, I'm ready to pay 100$ for sample with scalable multi tier db server and mobile (iOS, android) client ( load data, show in StrGrid, change\write) – Andy Birtman Sep 11 '15 at 09:23
  • https://en.wikipedia.org/wiki/Agile_software_development -> Working software over Comprehensive documentation – Andy Birtman Sep 11 '15 at 10:32
  • @AndyBirtman Yes, this is true about software, when working with senior developers, but IMHO not true about a framework like mORMot. You do not need a full documentation when you buy a house, but those who built the house needed a lot of information about each material or part they used. – Arnaud Bouchez Sep 13 '15 at 13:48
  • @Arnaud For carcass house may be. If I make typical block house I need information about typical parameters of block (sizes, maximum loads, limits). With delphi you can develop blocks house and carcass house. mORMot tools is tools for carcass building. I'm testing it. – Andy Birtman Sep 14 '15 at 08:10