Jump to content

Ruslan

Members
  • Content Count

    43
  • Joined

  • Last visited

Community Reputation

5 Neutral

About Ruslan

  • Birthday 12/30/1979

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Look at OpenCV, it's not a component but a very good library. Didn't used it in Delphi, only in C/C++ and Python.
  2. Did you try to change the fbclient library? In you example I suppose you are using the v3.
  3. Ruslan

    Looking for License Plate Recognition library

    You could look at https://github.com/ria-com/nomeroff-net . Some time ago I've developed a number plate recognition module for a large project.
  4. Ruslan

    Make calls from app and get status

    Hi all and Happy Holidays! Can anyone guide me how to use Kastri or native FMX for making and receiving calls from application? Also I need a method to control the calling process, eg to terminate the call after some seconds, and to get statuses (logs) for those calls (answered, no answer, invalid number, or any type of calling results). I've started with PhoneDialer example that came with Delphi, and tried to use smth like following example but can't get statuses. procedure TPhoneDialerForm.FormCreate(Sender: TObject); begin {$IFDEF ANDROID} FCallPhonePermission := JStringToString(TJManifest_permission.JavaClass.CALL_PHONE); FReadPhoneStatePermission := JStringToString(TJManifest_permission.JavaClass.READ_PHONE_STATE); FReadCallLogPermission := JStringToString(TJManifest_permission.JavaClass.READ_CALL_LOG); FManageOwnCalls := JStringToString(TJManifest_permission.JavaClass.MANAGE_OWN_CALLS); FBindTelecomService := JStringToString(TJManifest_permission.JavaClass.BIND_TELECOM_CONNECTION_SERVICE); //FReadPrecisePhoneState := JStringToString(TJManifest_permission.JavaClass.READ_PRECISE_PHONE_STATE); {$ENDIF} { test whether the PhoneDialer services are supported } TPlatformServices.Current.SupportsPlatformService(IFMXPhoneDialerService, FPhoneDialerService); PermissionsService.RequestPermissions([FCallPhonePermission,FReadPhoneStatePermission,FReadCallLogPermission,FManageOwnCalls,FBindTelecomService], procedure (const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray) begin if (Length(AGrantResults) = 5) and (AGrantResults[0] = TPermissionStatus.Granted) and (AGrantResults[1] = TPermissionStatus.Granted) and (AGrantResults[2] = TPermissionStatus.Granted) and (AGrantResults[3] = TPermissionStatus.Granted) and (AGrantResults[4] = TPermissionStatus.Granted) then begin ShowMessage('Permissions Activated!'); end; end ); FPhoneDialerService.OnCallStateChanged := CallStateChanged; end; procedure TPhoneDialerForm.CallStateChanged(const ACallID: string; const AState: TCallState); var Calls: TCalls; Call: TCall; begin case AState of TCallState.None: begin lbCalls.Items.Add(Format('%-16s %s', [ACallID, CallStateAsString(AState)])); end; TCallState.Connected: begin lbCalls.Items.Add(Format('%-16s %s', [ACallID, CallStateAsString(AState)])); end; TCallState.Incoming: begin Calls := FPhoneDialerService.GetCurrentCalls; try for Call in Calls do begin if Call.GetCallID = ACallID then begin lbCalls.Items.Add(Format('%-16s %s', [ACallID, CallStateAsString(AState)])); Exit; end; end; finally for Call in Calls do Call.Free; end; end; TCallState.Dialing: begin lbCalls.Items.Add(Format('%-16s %s', [ACallID, CallStateAsString(AState)])); end; TCallState.Disconnected: begin lbCalls.Items.Add(Format('%-16s %s', [ACallID, CallStateAsString(AState)])); end; end; end; function TPhoneDialerForm.CallStateAsString(AState: TCallState): String; begin case AState of TCallState.None: Result := 'None'; TCallState.Connected: Result := 'Connected'; TCallState.Incoming: Result := 'Incoming'; TCallState.Dialing: Result := 'Dialing'; TCallState.Disconnected: Result := 'Disconnected'; else Result := '<unknown>'; end; end; For the calling method I used these // Default method from example procedure TPhoneDialerForm.btnMakeCallClick(Sender: TObject); begin { test whether the PhoneDialer services are supported } if FPhoneDialerService <> nil then begin { if the Telephone Number is entered in the edit box then make the call, else display an error message } if edtTelephoneNumber.Text <> '' then begin PermissionsService.RequestPermissions([FCallPhonePermission], MakePhoneCallPermissionRequestResult, DisplayRationale) //FPhoneDialerService.Call(edtTelephoneNumber.Text); end else begin TDialogService.ShowMessage('Please type in a telephone number.'); edtTelephoneNumber.SetFocus; end; end else TDialogService.ShowMessage('PhoneDialer service not supported'); end; procedure TPhoneDialerForm.MakePhoneCallPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray); begin // 1 permission involved: CALL_PHONE if (Length(AGrantResults) = 1) and (AGrantResults[0] = TPermissionStatus.Granted) then FPhoneDialerService.Call(edtTelephoneNumber.Text) else TDialogService.ShowMessage('Cannot make a phone call because the required permission has not been granted'); end; // The other method for making calls procedure TPhoneDialerForm.MakeCall(const PhoneNumber: string); var Intent: JIntent; Uri: Jnet_Uri; begin Intent := TJIntent.Create; Intent.setAction(TJIntent.JavaClass.ACTION_CALL); Uri := TJnet_Uri.JavaClass.parse(StringToJString('tel:' + PhoneNumber)); Intent.setData(Uri); if TAndroidHelper.Activity.getPackageManager.queryIntentActivities(Intent, 0).size > 0 then TAndroidHelper.Activity.startActivity(Intent) else ShowMessage('No app to handle the call intent.'); end;
  5. For communication between apps/processes I used to use Redis Message Queue to send some signals between them or to send data. But I didn't use that way in Delphi yet (planning to). I agree with splitting GUI from the working code, for that I've chose MVVM pattern (ChatGPT gave me some examples but Grijji has a nice framework).
  6. Ruslan

    Delphi accessing remote Derby DB

    Also make sure that windows firewall doesn't block remote connection to the db.
  7. I'd better create a vpn server on the cloud to create a virtual LAN between 3 of your environments.
  8. Ruslan

    Error while installing fastreport

    Did you try to install it via GetIt? If so that try to clear the previous downloaded packages of Fastreport, then try to to install it again but running the IDE with administration rights (Run As Administrator).
  9. Ruslan

    What is proper way to crypt some fields?

    There is a way to encrypt the Firebird database, the is a sample in Firebird documentation. Unlucky me I wasn't able to create a encryption/decryption module for Firebird, most because of no time, maybe you could try to create one and share the results and will have a lot of thanks and appreciations for that. Most encryption/decryption modules prices are tooo big.
  10. I would capture that content (on exception of course) and will try to parse it for content that describes the error and display it to the user. But first I would try to collect all types of errors/html and create some kind of templates to make it easier for parser (from above) to get the right content.
  11. Ruslan

    Firebird transactions with Firedac

    SET SQL DIALECT 3; CREATE GENERATOR GEN_RECORD_NUMBER; SET TERM ^ ; CREATE OR ALTER TRIGGER ORDEN_BI FOR ORDEN ACTIVE BEFORE INSERT POSITION 0 as begin if ((new.number is null) or (new.number = 0)) then new.number = gen_id(GEN_RECORD_NUMBER,1); if ((new.guid is null) or (trim(new.guid) = '') ) then new.guid = '{' || uuid_to_char( gen_uuid() ) || '}'; end ^ SET TERM ; ^ I also use a GUID column as a unique field
  12. Ruslan

    SOAP Client debug

    Delphi 10.3.3 SOAP Server (unknown source but the server has it's a php) Imported the wsdl, no changes made to the unit. Tested requests to the server with SoapUI and everything goes fine, from Delphi application - there is no luck. All responses are about Schema mismatch. Using event HTTPRio.onBeforeExecute checked the request and it is the same as tested in SoapUI. Questions: How to debug a request? How to check if the request meets the schema rules? Any advanced docs/video on how to build SOAP client/server applications?
  13. Ruslan

    Firebird-Create Procedure

    Try to add BEGIN END for SUSPEND CREATE PROCEDURE "CUSTITEMMOVEMENT" ( "CUSTNO" INTEGER ) RETURNS ( "RNO" INTEGER, "TNAME" VARCHAR(5), "TDATE" DATE, "DOCNO" VARCHAR(12), "QTY" NUMERIC(18, 2), "NETPRICE" NUMERIC(18, 4), "ITEMNO" VARCHAR(20), "ITEMNAME" VARCHAR(40) ) AS BEGIN FOR SELECT IM.RNO,IM.TNAME,IM.TDATE,IM.DOCNO,IM.QTY, IM.NETPRICE,IM.ITEMNO, IT.ITEMNAME FROM ITEMMOVEMENTS IM JOIN ITEMS IT ON IT.ITEMNO=IM.ITEMNO WHERE (IM.CUSTNO= :"CUSTNO") ORDER BY IM.TDATE, IM.DOCNO INTO :"RNO",:"TNAME",:"TDATE",:"DOCNO",:"QTY",:"NETPRICE",:"ITEMNO",:"ITEMNAME" DO BEGIN SUSPEND; /* Line 26 is here */ END END ;
  14. Ruslan

    Firebird Admin Tool

    IBExpert, and you can get a free license if have WIN1251 (Russian) code page installed in your system
×