The method I suggest is as follows. Assuming you can use a scripting language on your server, first load the Local Database data into the Delphi application (Android).
To proceed, add the Indy HTTP library and the System Classes:
uses Classes, IdHTTP;
Create the necessary variables:
var
ParamList : TStringList; // Lista para representar o registro do banco
MyRow : TWhatever; // Esta variável hipotética representa o objeto ou array onde você terá o registro do Banco Local
HTTP : TIdHTTP; // Objeto HTTP do Indy
Put the data that should be passed to the server (single table record) into one TStringList
in the standard format of Uris:
ParamList.Add('id=' + MyRow.ID);
ParamList.Add('name=' + MyRow.Nome);
ParamList.Add('phone_number=' + MyRow.PhoneNumber);
// Adicione todos os campos da tabela.
After, you must create the Indy HTTP object and perform the POST for the Script on the server:
HTTP := TIdHTTP.Create(nil);
try
HTTP.Post('http://ip-ou-nome-do-servidor/pasta/do/script', ParamList);
finally
HTTP.Free;
ParamList.Free;
end;
The above example would send the Name, Surname and ID data to a server script (possibly in PHP or other language you prefer, know or want to learn). This script in turn would perform operations on the Remote Database (Server).
This is clearly just a generic and illustrative example. It contains the basic concepts for the method.
If you are not aware of any of the above terms, I suggest you study:
- HTTP
- POST and GET
- CGI scripts
I haven’t used Delphi for Android development yet, but I recommend you send requests for Scripts (PHP or other scripting language) on your server. Then these scripts could perform the changes in the database.
– Guill