Jump to content

mausmb

Members
  • Content Count

    55
  • Joined

  • Last visited

Posts posted by mausmb


  1. Closed : bug in 10.3.2 (SugarLoaf is working )

     

     

    Hi,

    I have a problem with intercepting SOAP packages. I'm using WSDL importer and THTTPRIO OnBeforeExecute and OnAfterExecute event.


    OnAfterExecute I get Soap response package without problem, but OnBeforeExecute Tstream (as String) is always empty. What I'm doing wrong ?


    procedure TDummyBeforeEx.Beforexecute(const MethodName: string;
      SOAPRequest: TStream);
    var
      sl : TStringList; 

    // If I'm ussing Array of byte is the same empty result when  encoding to string 
      begin
      sl := TStringList.Create;
      SOAPRequest.Position := 0;
      try
        sl.LoadFromStream(SOAPRequest);
        if sl.Text='' then // Always empty !
           exit;
        sl.Text := StringReplace(sl.Text, '<soap:Body>', '<soap:Body>XXX', [rfReplaceAll]);
        sl.SaveToStream(SOAPRequest);
      finally
        sl.Free;
      end;
    end;

    function GetKasaSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): KasaSoap;
    const
      defSvc  = 'Kasa';
      defPrt  = 'KasaSoap';
    var
      RIO: THTTPRIO;
    begin
      Result := nil;
      if (Addr = '') then
      begin
        if UseWSDL then
          Addr := defWSDL
        else
          Addr := defURL;
      end;
      if HTTPRIO = nil then
        RIO := THTTPRIO.Create(nil)
      else
        RIO := HTTPRIO;
      try
        rio.OnAfterExecute:=TDummyAfterEx.AfterExecute; // working as aspected
        rio.OnBeforeExecute:=TDummyBeforeEx.Beforexecute;
        RIO.Converter.Options:=RIO.Converter.Options+[TSOAPConvertOption.soSendMultiRefObj,TSOAPConvertOption.soSendMultiRefArray];
    //    RIO.HTTPWebNode.ConnectTimeout:=10;
    //    RIO.HTTPWebNode.SendTimeout :=10;
    //    RIO.HTTPWebNode.ReceiveTimeout:=10;
        Result := (RIO as KasaSoap);
        if UseWSDL then
        begin
          RIO.WSDLLocation := Addr;
          RIO.Service := defSvc;
          RIO.Port := defPrt;
        end else
          RIO.URL := Addr;
      finally
        if (Result = nil) and (HTTPRIO = nil) then
          RIO.Free;
      end;
    end;


    Regards,
    M


  2. 20 hours ago, TomDevOps said:

    How long you had to wait?

     

    I'm unable to proceed an update to the app and my update brings critical bug fixes. I have asked (as instructed by Sarina) week ago and still no response from Google 😞

     

    My clients are already a bit pissed off, we are still promising them fix, and although it has been fixed, we cannot it roll-out 😞 

    Hi,

     

    from July 23 - to August 1.

     

    br,

     

    • Like 1

  3. From Google Play today : 
     
    Thank you for your patience while we reviewing your request. 
     
    I'm happy to inform you that your app "*********" has been approved for 64-bit extension. Please note that the extension will only be given until August 1st, 2020.
     
    In addition, once your app is compliant with 64-bit, please let me know by replying this email. 
     
    Thank you for supporting Google Play. Have a nice day!
    • Like 2
    • Thanks 1

  4. Hi,

     

    property StyleElements: TStyleElements read FStyleElements write SetStyleElements default 7;

    Specifies the style elements that are used by the control.

    Use StyleElements to customize the style of the control. If a custom style is enabled, you can enable or disable style elements in the control.

    StyleElements is a set of values that specify which elements of the current style are to be applied to this control. By default, all the elements of the style are enabled.

     

    But for TdbNavigator  is not possibile to set styleelements .. partial success with grids...

     

    br,

    M

     


  5. On 2/6/2019 at 4:12 PM, Eli M. said:

    Maybe the problem is not specifically LiveBindings but trying to do too much on a single mobile screen at the same time.

     

    This project uses a number of different livebinded fields:

    https://community.embarcadero.com/article/16633-deep-dive-field-service-app-template-for-android-and-ios-with-rad-studio-10-2-tokyo

    Not going into "demo VS production" app area...Let's say (for the sake of the argument) that statement "but trying to do too much on a single mobile screen at the same time" is true .
    With Livebindings performance is poor. Without Livebindigs performance is good. So what's your argument again ? 🙂

     

    br,

    m


  6. 34 minutes ago, Marcio said:

    Hi, 

     

    I use livebinding to popular Listview.

    I'm affraid you won't get best UX&performance with livebindigs

     

    br,

    m

     

    p.s. If you have more complex ListView you can do it manually 🙂 with TAppearanceListViewItems... 

          LItem.Objects.FindDrawable('name').Width:=LColWidth; //
          LItem.Objects.FindDrawable('name').Data:=yourdata

     

    • Like 1

  7. Hi,

    I have all ListViews dynamicly created and "connected" to FDmemTable. Key word is "connected" - what do you mean with that ? With Live Bindings ?


    var
      LItem: TListViewItem;
    begin

    MyLV1.BeginUpdate;  
    MyLV1.Items.Clear;
    myFDmemTable.First;
    While not myFDmemTable.eof Do Begin
        LItem := MyLV1.Items.Add;
        LItem.Text := myFDmemTableName.AsString;
        LItem.Tag := myFDmemTableKey.AsInteger;  
    myFDmemTable.next;    
    end;
    MyLV1.EndUpdate;  

      

    Working fine (and fast) on Android 5.x to 9.1

    br,
    m


  8. This code working just fine in 10.3 Android & Windows ... dont' know with Tmodalresult

      TDialogService.MessageDialog((mymessage),
          system.UITypes.TMsgDlgType.mtConfirmation,
          [system.UITypes.TMsgDlgBtn.mbYes, system.UITypes.TMsgDlgBtn.mbNo], system.UITypes.TMsgDlgBtn.mbYes,0,
    procedure (const AResult: System.UITypes.TModalResult)
      begin
              case AResult of
                mrYES: Begin .....

    br,

    • Thanks 1

  9. 43 minutes ago, Rollo62 said:

    I think it should be good practice to request permission short before desired access,

    Not to request this generally in FormCreate or FormShow.

    If you do so rhe request will popup directly after app launched, maybe not even fully prepared, and users (like me) will see this quite suspicious.

    Yes and No - depending on functionality.   Almost all APP request permission when installed/started. It's tricky in Delphi to do that with new approach.  

    If you're for example reading i.e. setup. login, token,... from storage ... you don't have other option. if you just want access when app is up&running then is better to request permission when needed.

     

    br,

    Marjan 


  10. Quick Example :

     

    private 

    {$IFDEF ANDROID}
      fReadStorage:=JStringToString(TJManifest_permission.JavaClass.READ_EXTERNAL_STORAGE);
      fWriteStorage:=JStringToString(TJManifest_permission.JavaClass.WRITE_EXTERNAL_STORAGE);
      fBlueTooth:=JStringToString(TJManifest_permission.JavaClass.BLUETOOTH);
    {$ENDIF}


    procedure Tfrm????.FormShow(Sender: TObject);
    begin
    {$IF DEFINED(IOS) or DEFINED(ANDROID)}
    PermissionsService.RequestPermissions([fReadStorage,fWriteStorage,fBlueTooth], RequestPermissionsResult, DisplayRationale);
    {$ENDIF}
    end;

     

    procedure Tfrm????.RequestPermissionsResult(Sender: TObject; const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>);
    begin
      if (Length(AGrantResults) = 3) and (AGrantResults[0] = TPermissionStatus.Granted) and (AGrantResults[1] = TPermissionStatus.Granted) and (AGrantResults[2] = TPermissionStatus.Granted) then
         // execute procedure ...  as before on form show ...
      else Begin
        TDialogService.ShowMessage('No ....');
        Application.Terminate;
      End;
      // če ne bi dovolili permission bi moral showerror
    end;
    {$ENDIF}

     

    {$IF DEFINED(IOS) or DEFINED(ANDROID)}
    procedure Tfrm????..DisplayRationale(Sender: TObject; const APermissions: TArray<string>; const APostRationaleProc: TProc);
    var
      I: Integer;
      RationaleMsg: string;
    begin
      for I := 0 to High(APermissions) do
      begin
        if APermissions = fReadStorage then
          RationaleMsg := RationaleMsg + 'Aplikacija zahteva branje pomnilnika' + SLineBreak + SLineBreak
        else if APermissions = fWriteStorage then
          RationaleMsg := RationaleMsg + 'Aplikacija zahteva pisanje pomnilnika'+ SLineBreak + SLineBreak
       else if APermissions = fBlueTooth then
          RationaleMsg := RationaleMsg + 'Aplikacija zahteva BlueTooth';
      end;
      TDialogService.ShowMessage(RationaleMsg,
        procedure(const AResult: TModalResult)
        begin
          APostRationaleProc;
        end)
    end;
    {$ENDIF}

    • Like 1

  11. 19 hours ago, David Heffernan said:

    No such thing as EU decimal behaviour. Different countries in the EU have different locale settings. 

    That's not true at all 🙂 Maybe "EU decimal behaviour is wrong expression...maybe "locale settings not working (properly) with TNumberBox and Tedit. TnumberBox not working at all (enter 2.5 and Tnumberbox converts to 25 !).

     

    On Android :

    1. Tnumberbox display decimal numbers with  comma (",").

    2. when you enter decimal number you have to press DOT (".")  - that's contra intuitive for user when COMMA is displayed

    3. When you enter 2.5 Tnumberbox converts to 25

     

    There is such a thing :-) (The 22nd General Conference on Weights and Measures declared in 2003 that "the symbol for the decimal marker shall be either the point on the line or the comma on the line")

     

    examples (all EU countries and Canada w/o UK - if UK is EU country 🙂 using COMMA as decimal separator):

    https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html

    https://en.wikipedia.org/wiki/Decimal_separator

     

     

     

     

    TestNumbers.zip


  12. 5 hours ago, Lars Fosdal said:

    I wasn't really thinking of the complete list, just a place for DP members to post reports they have made or discovered.

    I found 3 bugs (but didn't report them to Quality portal)

    1. WSDL import 

    Rio 10.3 converts :    
    FCertBytes: TArray<System.Byte>;
    procedure SetCertBytes(Index: Integer; const ATArray<System.Byte>: TArray<System.Byte>);

    Everyt ByteArray converter names "Array" and <System.Byte> is Added 🙂

    Tokyo 10.2.3 converts : 
    FCertBytes: TByteDynArray;
    procedure SetCertBytes(Index: Integer; const ATByteDynArray: TByteDynArray);

     

    2. problems with time 

     

    3. DecimalSeparator and TnumberBox

     

     

     

    br,

    Marjan


  13. Hi,

     

    Any ideas how to enable EU decimal behaviour in Rio ? In both versions FloatToStr  returns number with ','

     

    NumberPad
    Delphi 10.2.3 behaviour  : you can enter ',' or '.' (comma is for EU right choice)
    Delphi 10.3 behaviour : Android keyboard displays ',' and '.'., but Enter ',' or '.' is not possibile

     

    DecimalNumberPad
    Delphi 10.2.3 behaviour  : you can enter ',' or '.' (comma is for EU right choice)
    Delphi 10.3 behaviour : Android keyboard displays ',' and '.'. Enter is  possibile. Entaer is ONLY for '.' , regardless that dispaly is with ',' 

     

    Regards,

    Marjan 


  14. 2 hours ago, Stefan Glienke said:

    What exactly do you do, what you posted is a private method that obviously gets called from another public method. Please show your code.

    type
      tblInovices: TFDMemTable;
      tblInovicesTimeTransaction: TDateTimeField; 
      
     ...
     
    onNewRecord...
       tblInovicesTimeTransaction.AsDateTime:=Time;
       
    afterpost - Prepare data and send it to Web (SOAP) web service   

     

      if tblInovicesTimeTransaction.Value<>Null then Begin
         wsInvoice.TimeTransaction:=TXSDateTime.Create;
         wsInvoice.TimeTransaction.AsUTCDateTime:=tblInovicesTimeTransaction.AsDateTime; // Exception sTimespanTooLong ..traced to Unit System.TimeSpan
    //    same Exception (sTimespanTooLong) Error with  AsDateTime
    //     wsInvoice.TimeTransaction.AsDateTime:=tblInovicesTimeTransaction.AsDateTime;
      End;

     

     

    Delphi103_timespanAndroid.png.cab4d9320e3556870d19e9b66b9660a5.png

    Regards,

    marjan 


  15. Hi,

     

    Working with time in DB datetime format  (example :  '30.12.1899 09:18:54')  on Android Delphi 10.3 throws exception- sTimespanTooLong. On Windows  (and previous Delphi version) is OK.

     

    class function TTimeSpan.GetScaledInterval(Value: Double; Scale: Integer): TTimeSpan;
    var
      NewVal: Double;
    begin
      if IsNan(Value) then
        raise EArgumentException.Create(sTimespanValueCannotBeNan);
      NewVal := Value * Scale;
      if Value >= 0.0 then
        NewVal := NewVal + 0.5
      else
        NewVal := NewVal - 0.5;
      if (NewVal > MaxMilliseconds) or (NewVal < MinMilliseconds) then
       raise EArgumentOutOfRangeException.Create(sTimespanTooLong);
      Result := TTimeSpan.Create(Trunc(NewVal) * TicksPerMillisecond);
    end;

     

    How to set initial datetime for Android ? 

     

    WorkAround is simple, but ugly

      if (NewVal > MaxMilliseconds) then
          NewVal:=MaxMilliseconds;
      if (NewVal < MinMilliseconds) then
          NewVal:=MinMilliseconds;

     

     

     

    Regards,

    Marjan 


  16. 4 hours ago, Yaron said:

    Debugging worked fine for me in v10.2.2 and stopped working in v10.2.3.

    I'm sad to report that even after doing a fresh install of the recently released Delphi v10.3, I am still getting the 'port in use' error when trying to debug.

     

    Perhaps this may be related to the Android libraries updates introduced in v10.2.3?

    And yes, I'm testing devices running Android v4-v6, which may also be related.

    Hi,

     

    1. If you have Phone Android version higher than SDK version ? it's a problem 😞 

    2. My Debug issues  After a few successful debug session (10.2.3 or 10.3)  debuging is not working anymore ('port in use' ) . Close Delphi, reconnect device and It's working again.

     

    Regards, Marjan

     

×