Hello
I think next code works, however please take a look and feel free to recommend me some settings or approaches, the idea is to have an Android RemoteDB server connected at SQLite, and any kind of Windows, iOS or even Android clients, in a client-server environment.
Don't worry about DB concurrency, just give me all the information I need to know that TMS components allow me to do that.
// Inicializamos la variable
SparkleServer := nil;
ConexionBaseDatos := Nil;
ConexionServidorRemoteDB := Nil;
// Creamos el servidor remoto
SparkleServer := TIndySparkleHTTPServer.Create();
SparkleServer.DefaultPort := 123;
// Especificamos los datos de conexion
ConexionBaseDatos := TDBConnectionFactory.Create(
function: IDBConnection
var
MiModuloDatos: TModuloDeDatos;
begin
MiModuloDatos := TModuloDeDatos.Create(Nil);
Result := TFireDacConnectionAdapter.Create(ModuloDeDatos.ConexionLocalBD, MiModuloDatos);
end
);
// Creamos la conexion RemoteDB
ConexionServidorRemoteDB := TRemoteDBModule.Create('http://localhost:123/A/B', ConexionBaseDatos);
ConexionServidorRemoteDB.UserName := '1';
ConexionServidorRemoteDB.Password := '2';
SparkleServer.Dispatcher.AddModule(ConexionServidorRemoteDB);
// Activamos el servidor remoto
SparkleServer.Active := True;
Thanks