Jump to content

Dave Nottage

Members
  • Content Count

    1296
  • Joined

  • Last visited

  • Days Won

    29

Posts posted by Dave Nottage


  1. 1 minute ago, Brandon Staggs said:

    I cannot find anything like that for FMX projects on MacOS.

    https://blog.grijjy.com/2021/10/18/build-your-own-error-reporter-part-3-macos-intel/

     

    Note that when this was published, there was yet to be support for ARM, however the last line says:

     

    "I may add some missing pieces to get this to work for ARM Mac apps as well"

     

    Since the code has not been updated since then, you'd need to either contact Erik or add an issue to the repo, regarding support for ARM.

    • Like 2
    • Thanks 1

  2. 3 hours ago, Fabian1648 said:

    Does anyone have any experience with Delphi, Android 14 and this notion of RECEIVER_EXPORTED / RECEIVER_NOT_EXPORTED flag?

    You might like to read this: https://developer.android.com/develop/background-work/background-tasks/broadcasts#context-registered-receivers

     

    ..and remember that I asked about what your code is doing. Presumably, part of it is registering a receiver at runtime, and it is not including RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED in the flags when calling registerReceiver.

    • Thanks 1

  3. On 5/10/2024 at 5:46 PM, Sherlock said:

    Since the dark mode is a non trivial thing to do with Delphi without the pesky skins

    It is relatively trivial in the IDE. There are however some "gotchas" with some controls that are not automatically themed, or not themed well - TGroupBox being one of them.

    On 5/10/2024 at 6:49 AM, Achim Kalwa said:

    I am working on making GExperts look good in that dark mode

    I've had a bit of a look into this myself. It would be relatively straightforward if it were not for the "gotchas" I mentioned above, and for the DpiScaler (part of GExperts) which seems to totally confuse theming of the title bars. Even with "disabling" the DpiScaler, the Grep Search (which is what I use most in GExperts) looks like this when themed (including title bar):


    image.thumb.png.97c302f9e299195a24d625fc40a9077b.png

     

    Note how the control to search for text is covered by the title bar, how horrid the TGroupBox controls look, etc. When I started theme support in Codex, I gave up on TGroupBox.

    Same form when not theming the title bar:


    image.thumb.png.3c3c6334c2cb080ba7754e3fb1383434.png

    • Like 1

  4. 3 minutes ago, Shano said:

    Can I download the compiled versions of the files from anywhere or do I have to go through the process of compiling them myself? 

    I did this quite some time ago, however it's for x86 simulator (as opposed to arm64, which is the only simulator architecture now supported by Delphi). See also this linkThis answer from SO might be useful.

     

    If it's just for http(s), I strongly recommend using the native HTTP client, because it makes development/deployment much, much easier.


  5. The target API level for Delphi 11.3 defaults to 32, which is Android 12. Since Android 10, access to shared folders has been restricted.

     

    You'll need to either  manually modify AndroidManifest.template.xml to change %targetSdkVersion% to 29 (Android 10) and ensure that the android:requestLegacyExternalStorage=true attribute is present on the application opening tag, or rethink how you're accessing files, e.g. whether they need to be in a shared area at all, and if so, whether to use MediaStore or DocumentsProvider.

     

    You may want to read this.

     


  6. 4 hours ago, Fabian1648 said:

    Does anyone have an idea how to solve this problem?

    Not sure why you would expect anyone to know without any detail whatsoever as to what your code is doing. You could use a logcat viewer to view what messages are coming from the device when the app attempts to start. See this link: 

     

    https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/LogViewers#android

    • Thanks 1

  7. 5 hours ago, tomye said:

    the only way is i have to upgrade the TFLite GPU delegate ( libtensorflowlite_gpu_jni. so ) to high version, maybe it can be supported. 

    I sincerely doubt that is the only way, however since you refuse to give a more complete example (not in a screenshot, and something that is sufficient to reproduce the issue), it's difficult to find an answer.

     

    Good luck


  8. 6 hours ago, tomye said:

    i can't get detail error message, beacuase it calls .so library file

    There's still insufficient detail in your code example (and screenshots are the worst form of example code).

    3 hours ago, tomye said:

    there are no any useful message 😞

    As per my initial reply, I said to use "a logcat viewer to look for related messages" (from the Android device), not messages in the IDE. 


  9. This:

    procedure(const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>)

    Needs to be:

    procedure(const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray)

    I believe the change to the types was related to C++Builder compatibility

    • Like 2

  10. 22 hours ago, CHackbart said:

    All the buttons on the remote are not detected, except the cursor keys.

    That's likely because there's only a few supported, including the arrow keys.  This is some code I used a while ago in a TV app, which I have not touched in some time:

     

    type
      TKeyNavigation = (None, Home, Back, Left, Right, Up, Down, OK);
    
    // KeyUp method is overridden from TForm  
    procedure TExampleForm.KeyUp(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState);
    var
      LKeyNavigation: TKeyNavigation;
      LIsTV: Boolean;
    begin
      // For the following code, please refer to: 
      // https://github.com/DelphiWorlds/Kastri/blob/c01b93369c2c33f8ab22acad611939be4789aae6/Core/DW.OSDevice.Android.pas#L216
      // and:
      // https://github.com/DelphiWorlds/Kastri/blob/c01b93369c2c33f8ab22acad611939be4789aae6/Core/DW.OSDevice.pas#L34
      LIsTV := TOSDevice.GetUIMode = TUIMode.Television;
      LKeyNavigation := TKeyNavigation.None;
      case Key of
        vkHardwareBack, vkEscape:
          LKeyNavigation := TKeyNavigation.Back;
        vkleft:
          LKeyNavigation := TKeyNavigation.Left;
        vkUp:
          LKeyNavigation := TKeyNavigation.Up;
        vkRight:
          LKeyNavigation := TKeyNavigation.Right;
        vkDown:
          LKeyNavigation := TKeyNavigation.Down;
        0, vkReturn:
        begin
          if KeyChar = #0 then
            LKeyNavigation := TKeyNavigation.OK;
        end;
      end;
      if FPreventExit and ((Key = vkHardwareBack) or (LIsTV and (Key = vkEscape))) then
      begin
        Key := 0;
        KeyChar := #0;
      end;
      if (LKeyNavigation <> TKeyNavigation.None) and LIsTV then
        KeyNavigation(LKeyNavigation);
    end;
    
    procedure TExampleForm.KeyNavigation(const ANavigation: TKeyNavigation);
    begin
      // Use this method to determine what to do with the navigation key
    end;

    Looking at it again now, it probably needs more work.


  11. Thanks to a message from @Stewag, I've been prompted to revisit this issue. The following code works on iOS 17. I expect it'll work on iOS 16 - not sure about earlier:

    unit Unit1;
    
    interface
    
    uses
      System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
      FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls;
    
    type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.fmx}
    
    uses
      Macapi.ObjectiveC, Macapi.Helpers,
      iOSapi.Foundation, iOSapi.UIKit, iOSapi.Helpers;
    
    type
      UIViewControllerEx = interface(UIViewController)
        ['{3E6C5FB2-20F2-4B42-BFD8-33968A80E809}']
        procedure setNeedsUpdateOfSupportedInterfaceOrientations; cdecl;
      end;
      TUIViewControllerEx = class(TOCGenericImport<UIViewControllerClass, UIViewControllerEx>)  end;
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      LID: Pointer;
    begin
      Application.FormFactor.Orientations := [TScreenOrientation.Portrait, TScreenOrientation.InvertedPortrait];
      if TOSVersion.Check(16) then
      begin
        LID := NSObjectToID(TiOSHelper.SharedApplication.keyWindow.rootViewController);
        TUIViewControllerEx.Wrap(LID).setNeedsUpdateOfSupportedInterfaceOrientations;
      end
      else
        TUIViewController.OCClass.attemptRotationToDeviceOrientation;
    end;

    If you run the app, then turn the device so that it is in landscape orientation, then click the button, it'll reorient the app into portrait.


  12. 5 hours ago, PascalBertrand said:

    Has anyone succeeded compiled Netcom7 for android platform. I have a error in nclines.pas : unsatisfied forward or external declaration ?

    Moving the procedure TConnectThread.ProcessEvent code out of the MSWINDOWS conditional define (e.g. move it to above the line {$IFDEF MSWINDOWS}) makes that unit compile. I had to also add System.Types to the implementation clause, for the DWord type.


  13. On 4/29/2024 at 10:37 AM, Dave Nottage said:

    You might be able to modify this code to use TMemo instead of TLabel:

    I had a brief look and it appears it may be much more complex with a TMemo


  14. 7 hours ago, zsleo said:

    The URL on server IIS is https://10.10.1.73

    I meant the complete URL, which (assuming you are not using URL rewriting) would need to be something like:

      https://10.10.1.73/MyApp/MyServer.dll/GetDecryptedPWD

    Where MyApp is the app you added to the website and MyServer.dll is your ISAPI dll.

     


  15. 7 hours ago, Alisson said:

    Does anyone have a tip on how I can use the kastri components even using an arm64 simulator?

    It seems for the Barcode Reader there are no compatible binaries that can be linked in by Delphi, for iOS simulator. If you're using this feature, you'll need to compile for a real device.


  16. 22 hours ago, sp0987 said:

    ...in accordance with project requirements

    I've never seen a project requirement that says something like: "the interface section of SysUtils must be modified in this way" - usually it's more like: "functionality X is required", and it may turn out that the most expedient solution to the requirement is to modify the source. Your description sounds a lot like: "we have SysUtils added to the uses clause of (almost) every unit in the project, so let's change that to avoid having to create another one of our own".

    25 minutes ago, David Heffernan said:

    I bet there's another way to solve your problem. If only you'd tell us what the actual problem was.

    Amen.

×