First of all I would like to thank you for this great product (FGX component). I have a problem when using TFgActivityDialog in "Release Mode" in Delphi 10.3 Rio. When i deploy my Android Application in PlayStore, the application can not save record into mySQL Server, meanwhile in "Debug Mode" (Developement) it can save record into MySQL Server. What should i do to make mycode work in "Release mode" (playStore)? Please help me...
Here is the code i wrote:
procedure TLocationForm.btnSendClick(Sender: TObject);
begin
with dmMyLocation do
begin
if not fgActivityDialog.IsShown then
begin
FActivityDialogThread := TThread.CreateAnonymousThread(procedure
begin
try
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Message := 'Please, Wait';
fgActivityDialog.Show;
end);
Sleep(1000);
if TThread.CheckTerminated then
Exit;
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Message := 'Sending data...';
try
UniConnection1.Connect;
qInsert.ExecSQL;
ShowMessage('Record was save into MySQL Server DB...'); //showup windows of dialog when data was save succesfully into db mysql server
except
on e:exception do
begin
ShowMessage(e.Message);
UniConnection1.Disconnect;
end;//exception
end;//try
//fgActivityDialog.ExecuteAction(btnSend);
end);
Sleep(1000);
if TThread.CheckTerminated then
Exit;
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Message := 'Finish';
end);
Sleep(500);
if TThread.CheckTerminated then
Exit;
finally
if not TThread.CheckTerminated then
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Hide;
end);
end;//try
end);//FActivityDialogThread
Вопрос
ksi
Dear Brovin Yaroslav
First of all I would like to thank you for this great product (FGX component). I have a problem when using TFgActivityDialog in "Release Mode" in Delphi 10.3 Rio. When i deploy my Android Application in PlayStore, the application can not save record into mySQL Server, meanwhile in "Debug Mode" (Developement) it can save record into MySQL Server. What should i do to make mycode work in "Release mode" (playStore)? Please help me...
Here is the code i wrote:
procedure TLocationForm.btnSendClick(Sender: TObject);
begin
with dmMyLocation do
begin
if not fgActivityDialog.IsShown then
begin
FActivityDialogThread := TThread.CreateAnonymousThread(procedure
begin
try
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Message := 'Please, Wait';
fgActivityDialog.Show;
end);
Sleep(1000);
if TThread.CheckTerminated then
Exit;
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Message := 'Sending data...';
qInsert.SQL.Clear;
qInsert.SQL.Add('INSERT INTO mabsensilokasi(');
qInsert.SQL.Add('idlokasi,');
qInsert.SQL.Add('tgllokasi,');
qInsert.SQL.Add('latx,');
qInsert.SQL.Add('longx,');
qInsert.SQL.Add('latlongx,');
qInsert.SQL.Add('namalokasi) ');
qInsert.SQL.Add('VALUES(');
qInsert.SQL.Add(':idlokasi,');
qInsert.SQL.Add(':tgllokasi,');
qInsert.SQL.Add(':latx,');
qInsert.SQL.Add(':longx,');
qInsert.SQL.Add(':latlongx,');
qInsert.SQL.Add(':namalokasi)');
qInsert.Prepare;
qInsert.Params[0].AsInteger := 0;
qInsert.Params[1].AsDateTime := Now;
qInsert.Params[2].AsFloat := strToFloat(ENUSLat);
qInsert.Params[3].AsFloat := strToFloat(ENUSLong);
qInsert.Params[4].AsString := ENUSLat+':'+ENUSLong;
qInsert.Params[5].AsString := edtNamaLokasi.Text;
try
UniConnection1.Connect;
qInsert.ExecSQL;
ShowMessage('Record was save into MySQL Server DB...'); //showup windows of dialog when data was save succesfully into db mysql server
except
on e:exception do
begin
ShowMessage(e.Message);
UniConnection1.Disconnect;
end;//exception
end;//try
//fgActivityDialog.ExecuteAction(btnSend);
end);
Sleep(1000);
if TThread.CheckTerminated then
Exit;
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Message := 'Finish';
end);
Sleep(500);
if TThread.CheckTerminated then
Exit;
finally
if not TThread.CheckTerminated then
TThread.Synchronize(nil, procedure
begin
fgActivityDialog.Hide;
end);
end;//try
end);//FActivityDialogThread
FActivityDialogThread.FreeOnTerminate := False;
FActivityDialogThread.Start;
end;//if
end;//endDM
end;//endProc
Ссылка на комментарий
12 ответов на этот вопрос
Рекомендуемые сообщения
Присоединяйтесь к обсуждению
Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.