Jump to content

bzwirs

Members
  • Content Count

    39
  • Joined

  • Last visited

Posts posted by bzwirs


  1. Delphi 11.2

    Winsoft PDFium

     

    In app for Windows and Android I am using PDFium to create an invoice as a PDF.  Included In the PDF are 2 lines of text that are colored red and one rectangle filled with color blue.  Using PDFium I need to use TAlphaColorRec.Red and TAlphaColorRec.Blue to display the color on the PDF.  This works fine on Windows but when compiled for Android the text colour shows as blue and the rectangle fill color is red (ie. opposite of the selected colors).  Reversing the colors fixes the problem for Android but would appreciate if someone can please explain why this would happen.

     

    Thanks

     

    Bill Zwirs


  2. Hi,

     

    Updated to Delphi 11.2 the other day and now unable to install apk file to android device (Tab6 Lite).  Compile gives me the following error

     

    image.thumb.png.3b15695ff610d5283d3cd9efbfe0bac5.png

     

    Have two android apps and both give the same error,  Can someone please help me understand what the problem is.

     

    Any help would be appreciated.  Thanks in advance

     

    Bill Zwirs


  3. Delphi 11.1

    Datasnap

     

    Having trouble writing a blob field from a client app to the database on server.  Client uses SQLite database and main database on server is Firebird.  Client app uses TMSFNCSignature Capture component to write the signature to the SQLite database blob field like this and the image is actually saved to the blob field:

     

    procedure TMainForm.Save_Signature;
    var
      ms   : tMemoryStream;
    begin
      ms := TMemoryStream.Create;
      EMUSig.SaveToImageStream(ms);
      Open_InvSigQry(MarafillerDM.FDQuerySchedSALEDATE.Value,
                     MarafillerDM.FDQuerySchedMACHID.Value);
      MarafillerDM.InvSigQry.Insert;
      MarafillerDM.InvSigQrySALEDATE.Value := MarafillerDM.FDQuerySchedSALEDATE.Value;
      MarafillerDM.InvSigQryMACHID.Value := MarafillerDM.FDQuerySchedMACHID.Value;
      MarafillerDM.InvSigQrySIGNATURE.LoadFromStream(ms);
      MarafillerDM.InvSigQry.Post;
      MarafillerDM.InvSigQry.Close;
    end;

     

    Using SQLite DBBrowser I can confirm that the image is written to the database (.png image).

     

    My problem is writing that image to a blob field on the server database (using datasnap for the connection).  The table I am writing to on the server has several fields including 1 blob field defined as - 'CUSTSIGNATURE   BLOB SUB_TYPE 0 SEGMENT SIZE 80' in the Firebird database.  I use the following code to write to the database.  The EMUInvQry gathers the necessary data to transfer from a couple of tables: 

     

    procedure TMainForm.Transfer_EMUInvoice;
    var
      ms    : tStream;
    begin
      MarafillerDM.EMUInvClient.Insert;
      MarafillerDM.EMUInvClientINVNUM.AsString := MarafillerDM.EMUInvQryDOCKET.AsString;
      MarafillerDM.EMUInvClientINVDATE.Value :=
                      ModifiedJulianDateToDateTime(MarafillerDM.EMUInvQrySALEDATE.Value);
      MarafillerDM.EMUInvClientMACHID.Value := MarafillerDM.EMUInvQryMACHID.Value;
      MarafillerDM.EMUInvClientTOTPKTS.Value := MarafillerDM.EMUInvQryPKTSALES.Value;
      MarafillerDM.EMUInvClientTOTVALUE.Value := MarafillerDM.EMUInvQryMACHVALUE.Value;
      MarafillerDM.EMUInvClientSITECODE.Value := MarafillerDM.EMUInvQrySITECODE.Value;
      MarafillerDM.EMUInvClientTOTRETPKTS.Value := MarafillerDM.EMUInvQryRETURN_PKTS.Value;
      MarafillerDM.EMUInvClientTOTRETVALUE.Value := MarafillerDM.EMUInvQryRETURN_VALUE.Value;
      MarafillerDM.EMUInvClientADJTOTPKTS.Value := MarafillerDM.EMUInvQryADJ_PKTS.Value;
      MarafillerDM.EMUInvClientADJTOTVALUE.Value := MarafillerDM.EMUInvQryADJ_VALUE.Value;
      if (MarafillerDM.EMUInvQryPAYEMUCOMM.AsString = 'F') then
        MarafillerDM.EMUInvClientCOMMISSION.Value := MarafillerDM.EMUInvQryCOMMISSION.Value;
      MarafillerDM.EMUInvClientBALANCEDUE.Value := MarafillerDM.EMUInvQryBAL_DUE.Value;
      MarafillerDM.EMUInvClientFILLER.AsString :=  sFillerName;
      ms := TStream.Create;
      MarafillerDM.EMUInvQrySIGNATURE.SaveToStream(ms);
      try
        if Assigned(ms) then
          MarafillerDM.EMUInvClientCUSTSIGNATURE.LoadFromStream(ms);
      finally
        ms.Free;
      end;

      MarafillerDM.EMUInvClient.Post;
    end;

     

    When I check the Firebird database, all fields are transferred except the blob field which is set to null. 

     

    Can someone please advise me how to correctly transfer the blob field data.  Have googled and tried a few different approaches but nothing works for me.  Obviously missing something but can't see the forest for the trees.

     

    Any help would be appreciated.

     

    Bill Zwirs


  4. Delphi 10.4.2

     

    Latest Android update has killed using S pen on edit field to bring up the virtual keyboard.  Using finger or other type stylus is Ok.  S pen does bring up the keyboard on other apps but not on the app compiled by Delphi. Have tried different settings on the tablet (Tab 6 Lite) but to no avail. 

     

    Has anybody had the same problem and is this an Android thing or do I need to add something to my program code?

     

    Any advice would be greatly appreciated.

     

    Bill Zwirs


  5. Delphi 10.4.2

    Have used sample code provided by 

    to send email with attachment from Android app and works fine.

     

    After I actually send email and have been returned to app I click a button to return me to the app's main menu screen (tab control) with this code

     

    TabControl1.SetActiveTabWithTransition(TabItem1,TTabTransition.Slide,TTabTransitionDirection.Reversed);

     

    but instead of returning back to main menu screen the current screen scrolls upwards and have to click button again to return to main menu screen.  After this every tab control screen behaves the same way and this only happens after the send email with attachment is used.

     

    I am using the sample code from Delphi Scrollable Form Demo provided by Delphi and believe this has something to do with my problem but don't understand how.

     

    Can someone please help me with this.

     

    Thanks in advance

     

    Bill

     


  6. Delphi 10.4.2

     

    Have debug parameter set to -cleaninstall in project options yet when I install to an Android device the database file (assets/internal) is not being replaced on the device.  Actually, was initially but suddenly not anymore.

     

    Can anybody PLEASE point me in the right direction to solve this.

     

    Any help would be greatly appreciated

     

    Bill


  7. Delphi 10.4.2

     

    I want to use assets/external when deploying a database file to an Android device.  The device doesn't actually have any external storage (sd card) so the installation auto creates a ./external directory in the internal app directory.  What is the correct way to set the database path.  Documentation says to use 'TPath.Combine(TPath.GetSharedDocumentsPath,'database.db') when using assets/external yet when I use this the app cannot find the database file. 

     

    Can someone please advise me as to where I am going wrong with this.

     

    Thanks in advance

     

    Bill


  8. Delphi 10.4.2

     

    Have developed a custom app for use on Android tablet for a business.  There will be approx 10 users of this app.  The plan is to notify users of any update through Google Drive allowing the user to receive a link and update there tablet with latest version of the app.  Especially in the early stages this may mean an updated database file (SQLite) in which case -cleaninstall is used.  On testing this, if I copy .apk file direct to tablet's download directory and then navigate to that directory and double click to install......all works and db file is replaced.  When testing this using Goole drive (same apk file) the app is updated but the db file is not replaced. 

     

    Should I be doing something else other than '-cleaninstall'

     

    Any advice would be appreciated.

     

    Bill Zwirs


  9. Latest Delphi

    Trying to send email from Android that is always sent to one address but can have up to 3 CC addresses......the send to address shows up ok in the email but not any of the CC addresses. The code I use is shown below.

     

    Intent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_SEND);
    
      sRecipients := TJavaObjectArray<JString>.Create(1);
      sRecipients.Items[0] := StringToJString(Recipient);
    
      ccRecipient := TJavaObjectArray<JString>.Create(1);
      ccRecipient.Items[0] := StringToJString(ccTechs);
    
      Intent.putExtra(TJIntent.JavaClass.EXTRA_EMAIL,sRecipients);
      Intent.putExtra(TJIntent.JavaClass.EXTRA_CC, ccRecipient);
      Intent.putExtra(TJIntent.JavaClass.EXTRA_SUBJECT, StringToJString(aSubject));
      Intent.putExtra(TJIntent.JavaClass.EXTRA_TEXT, StringToJString(aBody));
      Intent.setType(StringToJString('plain/text'));
      TAndroidHelper.Activity.startActivity(TJIntent.JavaClass.createChooser(Intent,
                                            StrToJCharSequence('Which email app?')));

    The ccTechs variable is a string of addresses - each address separated by a comma.

    All works fine except the ccRecipient is always missing.  

     

    Can someone please explain what I am doing wrong.

     

    Thanks in advance

     

    Bill Zwirs

     


  10. Hi,

     

    Trying to set up a customized view for Samsung Tab S7 which has an 11" screen.  I have been using the view for Android 10" and that works perfectly with the Samsung Tab S6 Lite but the customer now wants to use the Tab S7 and that places some of the buttons, nav bars in different positions on the S7 screen.  The manufacture specs for the S7 state resolution 1600X2560 pixels, 16:10 ratio, ~274 PPI.  Trying to followed the tutorial in the help file on Adding a Customized View to the View Selector but not sure where to get further information required such as MinPhysicalSize, MinLogicalSize and MaxLogicalSize as I am assuming the spec pixel size (1600 X 2560) is the MaxPhysicalSize.  Also don't understand where to get the 'Artwork' for this device.

     

    Has anybody managed to setup a customized view for this device that could help me with the required figures or am I going in the wrong direction.

     

    Any help would be appreciated.

     

    Bill Zwirs

×