Jump to content

Ranja AZ

Members
  • Content Count

    11
  • Joined

  • Last visited

Everything posted by Ranja AZ

  1. I need to intercepte USSD response in Android. Following link https://newbedev.com/prevent-ussd-dialog-and-read-ussd-response example written by Java, I need to create the same in Delphi but I have no idea. Else, Is there anyone who has experience on using TelephonyManager.UssdResponseCallback. (https://developer.android.com/reference/android/telephony/TelephonyManager.UssdResponseCallback)? Can help? Thanks
  2. Dave Nottage, thanks you again for your response! I'll try it! Regard
  3. Ranja AZ

    How to send and intercept USSD result

    Hello! Please, I need help about sending and receiving USSD: how will my program intercept the returned string. Here is the code I am using for sending first USSD code: unit UTestPhoneDialer; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Platform, FMX.PhoneDialer, FMX.StdCtrls, FMX.Controls.Presentation, FMX.Edit, FMX.Memo.Types, FMX.ScrollBox, FMX.Memo; type TForm1 = class(TForm) lblCarrierName: TLabel; lblISOCountryCode: TLabel; btnGetCarrierInfo: TButton; lblTelephoneNumber: TLabel; edtTelephoneNumber: TEdit; btnMakeCall: TButton; Memo1: TMemo; procedure btnGetCarrierInfoClick(Sender: TObject); procedure btnMakeCallClick(Sender: TObject); private { Déclarations privées } PhoneDialerService: IFMXPhoneDialerService; public { Déclarations publiques } constructor Create(AOwner: TComponent); override; end; var Form1: TForm1; implementation {$R *.fmx} {$R *.LgXhdpiPh.fmx ANDROID} procedure TForm1.btnGetCarrierInfoClick(Sender: TObject); begin { test whether the PhoneDialer services are supported on your device } if Assigned(PhoneDialerService) then begin { if yes, then update the labels with the retrieved information } lblCarrierName.Text := 'Carrier Name: ' + PhoneDialerService.GetCarrier.GetCarrierName; lblISOCountryCode.Text := 'ISO Country Code: ' + PhoneDialerService.GetCarrier.GetIsoCountryCode; end; end; procedure TForm1.btnMakeCallClick(Sender: TObject); begin { test whether the PhoneDialer services are supported on your device } if Assigned(PhoneDialerService) 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 PhoneDialerService.Call(edtTelephoneNumber.Text) else begin ShowMessage('Please type-in a telephone number.'); edtTelephoneNumber.SetFocus; end; end; end; constructor TForm1.Create(AOwner: TComponent); begin inherited Create(AOwner); TPlatformServices.Current.SupportsPlatformService(IFMXPhoneDialerService, IInterface(PhoneDialerService)); end; end. After first calling, Then I would have to respond to the different USSD information. How do I do? Regard!
  4. Ranja AZ

    TJHashset Java instruction to Delphi

    I have the following instruction in Java: HashSet<CardSlotTypeEnum> slotTypes = new HashSet<>(); How do I write this in Delphi? TJHashSet is in unit Androidapi.JNI.JavaTypes.
  5. Ranja AZ

    Amount input for Android POS

    I need a component like TEdit to enter amounts like $ 23,000.00. I see that TMaskEdit does not exist for FMX. What componant can I use? Regard.
  6. Ranja AZ

    Amount input for Android POS

    exmailx45: I can't use TDBEDIT for android, how do I do?
  7. Ranja AZ

    Amount input for Android POS

    Good morning all, Thank you for your help! I agree with Roll62's idea: just improve TEdit. In the meantime, I will try the currency edit program and also the simple emailx45 casting. Thanks a lot guys!
  8. Here is an instruction that I cannot convert to delphi: printer.startPrint(false, new OnPrintListener() { //roll paper or not @Override public void onPrintResult(final int retCode) { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(PrinterActivity.this, retCode + "", Toast.LENGTH_SHORT).show(); } }); } }); Regard.
  9. Thank you Dave! Your explanation is very clear. Now printing is OK now. Thank you so much. Regard
  10. I want to convert java code to delphi code. My problem is the call to new OnPrintListener () in the parameter. Regard
  11. Thank you for your reply! I have a java file (attached file) and I have java4delphi, can I convert this java file to .pas file with this tools? Please How to do that? Regard. PrinterActivity.java
×