#1  
Old 7th October 2019, 06:34 AM
chris chris is offline
Junior Member
 
Join Date: May 2015
Posts: 13
Default Mobile Client Library

Hi

I'm considering releasing a set of client components to allow accessing NexusDB from Android and iOS/OSX devices. I've been using the code in my own projects but never found the time to convert them to an actual component library, but I have now and I'm wondering if there's any demand before I spend more time writing an installer etc.

There are 5 components in the set:

Server Component:
TOSNXServer (Windows Only): HTTP(s) Server component that links to a TnxServerEngine and provides the actual data to the client. This supports Indy and RTC (StreamSec2 is needed for ssl with RTC, not with Indy). It's possible to write additional wrappers to add support for other HTTP libraries.

Client Components (Windows, Android, iOS, OSX):

TOSNXDBConnection: Handles the communication between the device and the windows server. Uses http on lan and HTTPS on wan, supports GZIP and Deflate.

TOSNXDBSession: Selects the alias and allows to set the NexusDB user

TOSNXQuery: Provides access to the actual data via SQL. This is a TDataset descendant so provides many of the normal properties and methods. It is a disconnected model so it downloads the data to the device in a single trip. It supports paging (to limit the amount of data sent to the device). This is readonly with all updates done in SQL (if you're not used to using SQL for updating, it really is pretty easy so don't be put off). Transactions are supported and the component works in blocking mode or in thread mode using anonymous procedures.

TOSNXStoredProc: Provides access to stored procedures on the server.

If there's enough interest I would offer the library for ?50 per developer (1 year of updates) with a 30 day no-questions money back guarantee (I don't want to have to create a trial so you'd have to buy it to try it).

This framework uses generics and anonymous methods and I've only tested the components on Rio (the code has been working on earlier releases though) so probably won't work on older releases of Delphi.

If you'd be interested please reply and let me know. I'd like to release an alpha in the next week or so.

Cheers

Chris
  #2  
Old 7th October 2019, 07:03 AM
Shane Stump
 
Posts: n/a
Default Re: Mobile Client Library

Howdy Chris!

I know I would be interested but I use C++ Builder and I am not sure if
you will run into trouble with Pascal generics / anonymous methods.

If they will work with C++ Builder (I am on 10.2.3 and 10.3.2), let me know.

All the best,

Shane
  #3  
Old 7th October 2019, 02:20 PM
Sue King
 
Posts: n/a
Default Re: Mobile Client Library

Hi Chris,

I could be interested at some time in the future. I'm not sure when as
I am doing a new system in Windows, for which I would like to have
initially an Android app for a particular purpose. At the moment, I am
too busy with the Windows code to have time to do much with Android.

If you don't do anything with them now, perhaps I can get in touch with
you when I am ready. I always create my components at run time, so an
installer might not be necessary anyway.

Will there be source available ? I would need that if I decided to use
the components.

Cheers,
Sue

chris wrote:

>
> Hi
>
> I'm considering releasing a set of client components to allow
> accessing NexusDB from Android and iOS/OSX devices. I've been using
> the code in my own projects but never found the time to convert them
> to an actual component library, but I have now and I'm wondering if
> there's any demand before I spend more time writing an installer etc.
>
> There are 5 components in the set:
>
> _Server_Component:_
> *TOSNXServer *(Windows Only): HTTP(s) Server component that links to a
> TnxServerEngine and provides the actual data to the client. This
> supports Indy and RTC (StreamSec2 is needed for ssl with RTC, not with
> Indy). It's possible to write additional wrappers to add support for
> other HTTP libraries.
>
> _Client_Components_(Windows,_Android,_iOS,_OSX):
> _
> TOSNXDBConnection: Handles the communication between the device and
> the windows server. Uses http on lan and HTTPS on wan, supports GZIP
> and Deflate.
>
> TOSNXDBSession: Selects the alias and allows to set the NexusDB user
>
> TOSNXQuery: Provides access to the actual data via SQL. This is a
> TDataset descendant so provides many of the normal properties and
> methods. It is a disconnected model so it downloads the data to the
> device in a single trip. It supports paging (to limit the amount of
> data sent to the device). This is readonly with all updates done in
> SQL (if you're not used to using SQL for updating, it really is
> pretty easy so don't be put off). Transactions are supported and the
> component works in blocking mode or in thread mode using anonymous
> procedures.
>
> TOSNXStoredProc: Provides access to stored procedures on the server.
>
> If there's enough interest I would offer the library for ?50 per
> developer (1 year of updates) with a 30 day no-questions money back
> guarantee (I don't want to have to create a trial so you'd have to buy
> it to try it).
>
> This framework uses generics and anonymous methods and I've only
> tested the components on Rio (the code has been working on earlier
> releases though) so probably won't work on older releases of Delphi.
>
> If you'd be interested please reply and let me know. I'd like to
> release an alpha in the next week or so.
>
> Cheers
>
> Chris


  #4  
Old 8th October 2019, 01:52 AM
Diniz
 
Posts: n/a
Default Re: Mobile Client Library

Em 06/10/2019 16:34, chris escreveu:

Hi Chirs

I have a "sales force" apk using datasnap with firedac (win) and sqlite
on android. Using ClientDataset + NxQuery to send data to Android,
saving data to SQLite + Firedac.

Now, I am migrating Datasnap to RestDataware (www.restdw.com.br), I will
no longer buy Delphi Enterprise, only the professional version.

So if your solution works with Delphi Professional, I'd like to try it,
I don't need any installation, just a small sample of how to use it ...
that's it.

Can I see one or more apk samples running?

thanks

Diniz
Brazil
  #5  
Old 8th October 2019, 05:12 AM
chris chris is offline
Junior Member
 
Join Date: May 2015
Posts: 13
Default

Hi

Shane:

I haven't tested in C++ but I'll try to find time and let you know. (You could convert to Delphi like I did )

Sue:

Yes, full source will be provided

Diniz:

Yes, works with Pro. I'll get something posted to our website and post a link here.

Cheers

Chris
  #6  
Old 8th October 2019, 10:34 AM
Shane Stump
 
Posts: n/a
Default Re: Mobile Client Library

On 10/7/2019 1:12 PM, chris wrote:
> Hi
>
> Shane:
>
> I haven't tested in C++ but I'll try to find time and let you know. (You
> could convert to Delphi like I did )


Howdy Chris!

I can't afford to go backwards <bg>!

All the best,

Shane
  #7  
Old 9th October 2019, 03:19 AM
chris chris is offline
Junior Member
 
Join Date: May 2015
Posts: 13
Default

Quote:
Originally Posted by Shane Stump View Post
On 10/7/2019 1:12 PM, chris wrote:
> Hi
>
> Shane:
>
> I haven't tested in C++ but I'll try to find time and let you know. (You
> could convert to Delphi like I did )


Howdy Chris!

I can't afford to go backwards <bg>!

All the best,

Shane
Well I do miss the 20 minute breaks while waiting for the compiler :-)
  #8  
Old 9th October 2019, 03:26 AM
chris chris is offline
Junior Member
 
Join Date: May 2015
Posts: 13
Default

I've posted a sample to https://www.onyxsoftware.co.uk/OSNXC...rarySample.zip

There's a windows server that must be running first, it needs to be able to connect to a running NexusDB server over TCPIP.

There's also a client apk to install on your device.

The code for both is:

Server

Code:
procedure TfrmServer.ck1Click(Sender: TObject);
begin
  osnxsrvr1.HTTPServer.HTTPPort := StrToInt(txtPort.Text);
  osnxsrvr1.HTTPServer.SSLPort := StrToInt(txtSSLPort.Text);
  if ck1.Checked then
    osnxsrvr1.HTTPServer.StartListening()
  else
    osnxsrvr1.HTTPServer.StopListening();
end;

procedure TfrmServer.cknxServerStatusClick(Sender: TObject);
begin
  nxWinsockTransport1.ServerName := txtDBServerIP.Text;
  nxWinsockTransport1.Port := StrToInt(txtDBServerPort.Text);
  nxWinsockTransport1.Active := true;
  cknxServerStatus.Checked := nxWinsockTransport1.Active;
end;

procedure TfrmServer.osnxsrvr1CreateHTTPServer(Sender: TObject);
var
  SSLFolder : String;
begin
  //We support Indy and RTC but you can create wrappers for your own provider
  osnxsrvr1.HTTPServer := TOSnxIndyHTTPServer.Create();
  //Set the port that will be used on the lan (i.e. no ssl)
  osnxsrvr1.HTTPServer.HTTPPort := 90;
  //Set the port that the mobile devices will use when connecting outside of the lan, port forwarding will be needed
  osnxsrvr1.HTTPServer.SSLPort := 500;
  //We support Deflate and GZip
  osnxsrvr1.HTTPServer.Deflate := true;
  //This is SSL for Indy, RTC is slightly different and requires a third party SSL provider
  SSLFolder := ExtractFileDir(Application.ExeName);
  SSLFolder := TPath.Combine(SSLFolder,'IndySSL');
  //If this fails then the certificates have probably expired
  osnxsrvr1.HTTPServer.SetSSLFiles(TPath.Combine(SSLFolder,'ca.root.pem'),
                                    TPath.Combine(SSLFolder,'cert.pem'),
                                    TPath.Combine(SSLFolder,'key.pem'),
                                    'abcd');

  //Mobile clients need to authenticate to the HTTP server so add a user here
  osnxsrvr1.Users.Add(TOSUser.Create('Chris','CloudCarpetFence'));

end;
and for the client

Code:
procedure TfrmClientMain.cmdRunSQLClick(Sender: TObject);
begin
  if txtAliasName.Text = '' then
  begin
    ShowMessage('Please enter a DB Alias');
    exit;
  end;

  cmdRunSQL.Enabled := false;
  DBConnection.ServerAddress := txtServerAddress.Text;
  DBConnection.ServerUserName := txtUserName.Text;
  DBConnection.ServerPassword := txtPassword.Text;

  Session.AliasName := txtAliasName.Text;
  Qry.SQL.Clear();
  Qry.SQL.Add(mmoSQL.Text);
  Qry.Open(
    procedure(AQry:TOSNXQuery;ASuccess:boolean;E:Exception)
    begin
      cmdRunSQL.Enabled := true;
      if not ASuccess then
        ShowMessage(E.Message);
    end);
end;
Please let me know if you have any problems or further questions.

Cheers

Chris
  #9  
Old 9th October 2019, 06:14 AM
Shane Stump
 
Posts: n/a
Default Re: Mobile Client Library

On 10/8/2019 11:19 AM, chris wrote:
> Shane Stump;112674 Wrote:
>> On 10/7/2019 1:12 PM, chris wrote:
>>> Hi
>>>
>>> Shane:
>>>
>>> I haven't tested in C++ but I'll try to find time and let you know.

>> (You
>>> could convert to Delphi like I did )

>>
>> Howdy Chris!
>>
>> I can't afford to go backwards <bg>!
>>
>> All the best,
>>
>> Shane

>
> Well I do miss the 20 minute breaks while waiting for the compiler :-)
>
>

Yes but I didn't have to wait for YEARS for things like templates, for
(int variable), etc <lol>!

Plus, nothing a $2000 processor couldn't take care of.
  #10  
Old 10th October 2019, 12:37 AM
Diniz
 
Posts: n/a
Default Re: Mobile Client Library

Em 08/10/2019 13:26, chris escreveu:
> I've posted a sample to
> https://www.onyxsoftware.co.uk/OSNXC...rarySample.zip


Congratulations !!!

Good Job!!!

Works well and fast !!!

Some configurations in Router was neccessary, but simples.

I'm interested

Diniz


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can mobile devices like iPhone, iPad or Android show client screenvia nexus portal gateway? Chau Chee Yang nexusdb.public.support.portal 2 20th April 2012 11:56 PM
OT: Free library to compress data jprenou nexusdb.public.discussions 39 26th April 2011 03:09 AM
Library path in Delphi jprenou nexusdb.public.support 1 30th September 2009 08:11 PM
Exception on program exit caused by Jedi library and CodeSite Robert Meek nexusdb.public.support 4 28th August 2003 07:57 AM
OT: Good PDF creator library for delphi ? Roberto Nicchi nexusdb.public.discussions 4 1st January 1970 10:00 AM


All times are GMT +11. The time now is 10:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.