Jump to content

toufik

Members
  • Content Count

    75
  • Joined

  • Last visited

Everything posted by toufik

  1. good morning every one .. its work just fine in windows ,, and in android its doesn't execute the procedure called StartLogin10 after the user choses yes ,, nothing happen ....can someone help please thanks ... i have this code below : procedure TFrmLogin.SpeedButton5Click(Sender: TObject); var Reply : Integer; begin if (lst2.Items.Count <> 0) and (lst2.ItemIndex <> -1)then begin Reply := 0; TDialogService.MessageDialog('you are gonna edit something ', TMsgDlgType.mtInformation, [TMsgDlgBtn.mbYes], TMsgDlgBtn.mbYes,0, procedure(const AResult: TModalResult) begin Reply := AResult; end ); if Reply =mrYes then StartLogin10 ;******************************************** end else ShowMessage( 'you have cancel the operation'); end else ShowMessage('chose something from the list');
  2. toufik

    Correctly displaying a Message Dialog in FireMonkey

    @Remy Lebeau thanks alot for taking a time to reply ,,,now its work with small change in line TDialogService.MessageDialog('you are gonna edit something ', TMsgDlgType.mtInformation, [TMsgDlgBtn.mbYes], TMsgDlgBtn.mbYes,0, to TDialogService.MessageDialog('you are gonna edit something ', TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], TMsgDlgBtn.mbYes, 0,
  3. toufik

    TListView Paging

    good morning every one ^^... TListView Paging**** is this look logic to you ? a mobile app + rest . I want to be able to get 10 record every time . so how about putting the last record i get every time and send it back to the server side to get 10 more record starting with it ,,,,and so on ... is this look ok to you thank you
  4. toufik

    TListView Paging

    I have to ask is this the proper way to do it though ?
  5. toufik

    TListView Paging

    thank you for taking time to reply .
  6. hi every one can some one help me with problem I'm using Delphi REST with server and client but when i tried to show data on the client side its show only one row for some reason, what did i do wrong ? PS : I'm using Delphi roi and restdataware the video down show what I'm deal with ; any help will be very appreciated ^^ thank you on the client side i'm using this code procedure listv; var jsonObj : TJsonObject; json, sucesso, erro,id_store ,nom_store, phone_saler: string; begin // FrmLogin.FloatAnimation2.Stop; // FrmLogin.FloatAnimation3.Stop; if FrmLogin.listvreq.Response.JSONValue = nil then begin // FrmLogin.ExibirCampos; ShowMessage('خطأ في إنشاء الحساب (JSON غير صالح)'); exit; end; try json := FrmLogin.listvreq.Response.JSONValue.ToString; jsonObj := TJSONObject.ParseJSONValue(TEncoding.UTF8.GetBytes(json), 0) as TJSONObject; sucesso := jsonObj.GetValue('sucesso').Value; erro := jsonObj.GetValue('erro').Value; id_store := jsonObj.GetValue('id_store').Value; nom_store := jsonObj.GetValue('nom_store').Value; if sucesso <> 'S' then begin // FrmLogin.ExibirCampos; ShowMessage(erro); exit; end else // showmessage('تم احضار بيانات: ' + id_store+nom_store); // FrmLogin.ExibirCampos;/// // FrmLogin.ListView1.Items.Clear(); finally jsonObj.DisposeOf; end; end; procedure listverr(Sender: TObject); begin if Assigned(Sender) and (Sender is Exception) then begin // FrmLogin.ExibirCampos; showmessage(Exception(Sender).Message); end; end; procedure TFrmLogin.StartLogin2; begin TThread.CreateAnonymousThread( procedure var Success: Boolean; begin try RequestLogin.Execute; Success := RequestLogin.Response.Status.Success; except Success := False; end; TThread.Queue(nil, procedure begin AfterLogin2(Success); end ); end ).Start; end; procedure TFrmLogin.AfterLogin2(Success: Boolean); begin if Success then begin listvreq.Params.Clear; listvreq.AddParameter('type_store',ComboBox1.Selected.Text); /// **** listvreq.ExecuteAsync(listv, true, true, listverr); end else begin showmessage (' عفوا ...! لايمكن الاتصال بالخادم حاليا يرجى المحاولة لاحقا') end; on server side : procedure Tdm.DWEventsEventslistvReplyEvent(var Params: TDWParams; var Result: string); var type_store, erro : string; usuario : TUsuario; json : TJsonObject; begin try sleep(4000); type_store := Params.ItemsString['type_store'].AsString; json := TJsonObject.Create; usuario := TUsuario.Create(dm.conn); usuario.type_store := type_store; if NOT usuario.listv(erro) then begin //{"sucesso": "N", "erro":"Usuلrio nمo informado", "codusuario":"0"} json.AddPair('sucesso', 'N'); json.AddPair('erro', erro); json.AddPair('id_store', ''); json.AddPair('nom_store', ''); end else begin json.AddPair('sucesso', 'S'); json.AddPair('erro', ''); json.AddPair('id_store', usuario.id_store.ToString); json.AddPair('nom_store', usuario.nom_store); end; Result := json.ToString; finally json.DisposeOf; usuario.DisposeOf; end; and in class i add called unit usuario function TUsuario.listv(out erro: string): Boolean; var qry : TFDQuery; begin try qry := TFDQuery.Create(nil); qry.Connection := FConn; with qry do begin Active := false; SQL.Clear; SQL.Add('SELECT * from saler WHERE type_store = :any '); ParamByName('any').Value := type_store; Active := true; if RecordCount > 0 then begin id_store := FieldByName('id_store').AsInteger; nom_store := FieldByName('nom_store').AsString; erro := ''; Result := true; end else begin // id_store := 0; erro := 'تعذر جلب بيانات المعلنين'; Result := false; end; DisposeOf; end; except on ex:exception do begin erro := 'خطأ في التحقق من صحة تسجيل الدخول: ' + ex.Message; Result := false; end; end; bandicam_2021-05-01_17-50-29-913.mp4
  7. thanks for taking time to reply i found that i did not add an array , tjsonarray , that fix it for me
  8. hello every one can some one help convert Thorse procedure unit to Tdwserverevent thank you in advance the code on Thorse are: unit uServico; interface uses Horse, System.SysUtils, DataSet.Serialize; procedure Servico(App: THorse); procedure Get(Req: THorseRequest; Res: THorseResponse; Next: TProc); implementation uses dmPrincipal; procedure Get(Req: THorseRequest; Res: THorseResponse; Next: TProc); begin try try DataModule1 := TDataModule1.Create(nil); DataModule1.FDQuery1.Close; if req.Params.Count > 0 then begin DataModule1.FDQuery1.FetchOptions.RecsSkip:= strtointdef(req.Params.Items['pagina'],1) * strtointdef(req.Params.Items['max'],1); DataModule1.FDQuery1.FetchOptions.RecsMax:= strtointdef(req.Params.Items['max'],1); end; DataModule1.FDQuery1.Open(); Res.Send(DataModule1.FDQuery1.ToJSONArray.ToJSON); finally Res.Status(200); FreeAndNil(DataModule1); end; except on e: exception do begin Res.Send(e.Message); Res.Status(400); end; end; end; procedure Servico(App: THorse); begin App.Get('/saler/:pagina/:max', Get); end;
  9. hello every one I want to play videos one by one , when one finished the second one start and that on ,like slidshow but with videos not pictures , using tMediaPlayer ,how can I approach that ? or is there a way to detect when start and end of a video ?thank you
  10. toufik

    play all videos in one folder delphi?

    thank you very much
  11. toufik

    loop a table field

    hello every on , i'm using this code to loop a sqllite database field called 'photos' and not doing the job for me im using a timer for that named tmr1 where is the problem please thank you ps : this loop stop when one of fields value is empty tmr1.Enabled := False; if not FDTableTask.IsEmpty and not FDTableTask.FieldByName('photos').IsNull and FileExists(FDTableTask.FieldByName('photos').asString) then begin FDTableTask.next; // ImageEnView2.PrepareTransition; // ImageEnView2.RunTransition( TIETransitionType( 1 + random( ord( High( TIETransitionType )) - 2 )), 550); // tmr1.Enabled := true; while FDTableTask.EOF do begin FDTableTask.First; end; end; tmr1.Enabled := true;
  12. hello every one ..............how to store a video location to database and restore to play it in tMediaPlayer ? thank you
  13. @emailx45 thank you its work thanks a lot ^^
  14. toufik

    The location of sqllite database ?

    good morning every one ^^ how is every one doing )) 1- i have fmx android app that s create sqllite db on create ,what's the location of db on the phone and is it const location ? (does not change for every other phones) 2- what's the proper way to copy it from that location to sd card (backup) ? thanks and take care
  15. Hello every one ... I have this very important question and its help a lot if any one can help me with it, I have an FMX app working normally on some Android versions 5 and 5.1 and 4.4 and with some medication on Android 10 and not working at all on other one ,its crash in startup in 6 and 9 ,and on android 7.1 and 8 its stuck on splash screen i have SDK and NDK and JAVA files set up correctly like the images shown bellow ,I did edit the AndroidManifest.template.xml so minSdkVersion="19" and targetSdkVersion="29" by the way the app request Camera permission and connect to fire-Dec database app on create cause im using ZXing project in my app what's I'm missing here .
  16. Hi all Delphier , good morning 😀😀 i have rest firemonkey app ,server , client im trying to check if the server is up or down from the client side using the code below , the code work fine , but when i run it its freeze the app for a while is there any proper way to do this ,thank you ,🤓☺️ try RequestLogin.Execute; if FrmLogin.RequestLogin.Response.Status.Success then begin showmessage ('server up') do something ..... end else except on e : exception do begin showmessage (' server down.... go home ') end end;
  17. @Uwe Raabe Thank you for reply ^ i will try that too , and of curse the first solution work just fine too .
  18. I can't thank you enough ,thank s a lot
  19. @Remy Lebeau i will try it ,,,,,thank you and ,,, if there any example to how to do this , it will be helpful thank you
  20. i did get this form the programmer who has written NetCom7 : you can pass that information to the server by packing it in the aData parameter (for example, you could pack the other client's info and the data with a TStringList.CommaText and pass that as aData). Now, the server will have to unpack the aData, again using TStringList.CommaText, and i'm trying it right now
  21. Thank you very much for help , i will try to accomplish what you suggested ,again thank you ^^
  22. @aehimself Thank a lot for reply , and yes there is demo folder , but it s missing what i'm looking for , the demos contain chat application ,that all client can see the text message that one client sent 'see the picture' and i want like i said before client 1 select client 2 to text with privately , i hope you understand the idea
  23. @aehimself i don't know the guy who made that , and i'm not here for any advertising by the way maybe he deserve an advertisement ^^
×