Jump to content

Dave Nottage

Members
  • Content Count

    1279
  • Joined

  • Last visited

  • Days Won

    28

Posts posted by Dave Nottage


  1. 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


  2. 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.

     


  3. 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.


  4. 1 hour ago, Alisson said:

    Desconfio que seja algo relacionado as bibliotecas Kastri master. Tenho outro app que não possui a biblioteca e funciona normalmente no IOS Simulator ARM 64 bits

    Which features from Kastri are you compiling? You may just need to change the value in the Framework search paths setting in the Project Options to point to the Simulator binaries, if any are available.


  5. Just now, Rollo62 said:

    I assumed that XCode 15 won't support or can handle older iOS 16.x SDKs any longer.

    Xcode 15 doesn't have iOS 16.x SDKs, no.. but that does not mean you cannot debug iOS 16 (or earlier) devices.

    1 minute ago, Rollo62 said:

    Can you confirm that XCode 15 can still be used for debugging same as XCode 14.3.1, under iOS 16.x, without too much trickery ?

    With no "trickery" whatsoever. iOS 16.x devices do not have the new debugging support introduced in iOS 17, and Xcode 15 handles that.

    7 minutes ago, Rollo62 said:

    The older SDK will have to be hooked into XCode manually, with all possible incompatibilities.

    Not sure what you mean by "manually". The only "incompatibilities" are if you attempt to use features in code available in the newer SDK on a device with an older OS (when the feature is not available in that older OS).

    9 minutes ago, Rollo62 said:

    Older iOS SDKs are not directly available through official channels.
           They must be extracted from an older Xcode version.

    That's true, however you can import an iOS 17.x SDK from Xcode 15, build your app against it, and It will happily run on an iOS 16.x device (as long as you do not attempt to use features from a newer OS, as mentioned above), and you can use the debugger with Delphi. As I mentioned earlier, it's debugging with an iOS 17.x device that is the major issue right now.


  6. 12 hours ago, Rollo62 said:

    Would be great if there is a way, to make XCode 15 compatible with Delphi, or vice versa.

    Delphi can already use Xcode 15. The biggest issue at the moment is debugging with iOS 17 (or higher) devices, which is a problem regardless of Xcode version. Debugging on devices with iOS 16.x still works using Xcode 15. A secondary issue is this onea problem if your app needs to link to 3rd party binaries that were built with Xcode 14 or higher.

     

    • Like 2

  7. 11 hours ago, Keesver said:

    'm using class TLocalReceiver from a Kastri sample application. When I create a new instance from this class I run into an exception:

    If you're using a demo app, you should not receive that error. The Java type comes from a java library from the Lib folder in Kastri, and which one will depend on the version of Delphi you are using.

    • Delphi 10.x:  dw-kastri-base.jar
    • Delphi 11.x: dw-kastri-base-2.0.0.jar
    • Delphi 12.x: dw-kastri-base-3.0.0.jar

    The relevant jar file would have been added to the Libraries node of the Android 32-bit target in Project Manager, e.g (Delphi 12.x):

     

    image.thumb.png.9361ceac0b49df0de6dacaa7c01f36ef.png

    <snip>
    image.thumb.png.519094f1cc9d20cfc18dad277b61b017.png

     

    Which should be compiled in with the app, unless you're using Delphi 11.3, which requires a workaround.

     


  8. 3 hours ago, Dave Nottage said:

    If so, I'll revisit this since I haven't looked at it since upgrading to 12.1.

    I revisited it anyway, and have attached the updated test project. Using Codex 2.2.0 I downloaded the AndroidX appcompat package (note that it should be v1.2.0 to align with what Delphi 12.1 uses):

     

    image.thumb.png.703b2603dd0e5cacabafa320868a675a.png


    ..and added it using the Add Android Package menu item that Codex adds to the Project Manager context menu. This is after deploying at least once, so that resources are merged properly.

     

    image.thumb.png.b8645280c72016f5b86db7d691445b9e.png

     

    In Delphi 12.1 deploying at least once also means that AndroidManifest.template.xml is created (in 12.0 and earlier it is created when building, rather than deploying), and the following is added to it, just before <%activity%>:

            <activity
                android:name="com.delphiworlds.kastri.DWFilesActivity"
                android:excludeFromRecents="true"
                android:exported="true">
                <intent-filter>
                    <action android:name="android.intent.action.VIEW" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.BROWSABLE" />
                    <data android:mimeType="*/*" />
                    <data android:scheme="content" />
                    <data android:host="*" />
                </intent-filter>
            </activity>

    ..and of course, the dw.filesactivity.jar library is added to the Android 32-bit Libraries node (does not need to be added to 64-bit unless you're using Delphi 11.3)

    RSP41337.zip


  9. 6 hours ago, vinni said:

    Dave, thanks for your suggestion. I gave it a try, but on my side AJavaScriptResult is always 'null' for any website.

    Is this on Windows? If so, are you setting the WindowsEngine property of the TWebBrowser to EdgeOnly? The result you're seeing happens if TWebBrowser uses IE.


  10. 1 hour ago, rvk said:

    No, unfortunately TWebBrowser.Document isn't available for FMX.

    There is no Document property, however there is a way of accessing the underlying web view (ICoreWebView2 on Windows, JWebView on Android and WKWebView on macOS/iOS), e.g. on Android:

    var
      LWebView: JWebView;
    begin
      if Supports(WebBrowser1, JWebView, LWebView) then
        // Do something with LWebView
    end;

    That said, as time goes on the underlying web view (on all platforms) has had direct access to HTML removed, so it has become necessary to execute JavaScript to achieve the same thing. Unfortunately, TWebBrowser has only EvaluateJavascript, which does not support returning a result, so it's necessary to use the technique above to achieve this, as I've done in the WebBrowserExt feature in Kastri (demo here). Using TWebBrowserExt, ExecuteJavaScript could be called with cJavaScriptGetPageContents (from the DW.JavaScript unit), thus:
     

    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.WebBrowser, FMX.Controls.Presentation, FMX.StdCtrls,
      DW.WebBrowserExt;
    
    type
      TForm1 = class(TForm)
        WebBrowser1: TWebBrowser;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
        procedure WebBrowser1DidFinishLoad(ASender: TObject);
      private
        FWebBrowserExt: TWebBrowserExt;
      public
        constructor Create(AOwner: TComponent); override;
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.fmx}
    
    uses
      DW.JavaScript;
    
    { TForm1 }
    
    constructor TForm1.Create(AOwner: TComponent);
    begin
      inherited;
      WebBrowser1.WindowsEngine := TWindowsEngine.EdgeOnly; // On Windows, unlikely to work with IE
      FWebBrowserExt := TWebBrowserExt.Create(WebBrowser1);
    end;
    
    procedure TForm1.WebBrowser1DidFinishLoad(ASender: TObject);
    begin
      FWebBrowserExt.ExecuteJavaScript(cJavaScriptGetPageContents,
        procedure(const AJavaScriptResult: string; const AErrorCode: Integer)
        begin
          // AJavaScriptResult should now contain the page contents
        end
      );
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      WebBrowser1.Navigate('http://help.websiteos.com/websiteos/example_of_a_simple_html_page.htm');
    end;
    
    end.
    

     

    2 hours ago, rvk said:

    Not sure whether that answer was wrong in 2017, but it's certainly incomplete now, given the above.


  11. 42 minutes ago, TTSander said:

    Then when I call

    
    TJXcBarcodeScanner.JavaClass.startScan;

    nothing happens.

    Does this mean you've moved on from attempting to generate a custom classes.dex?

     

    Going by their documentation, the init method needs to be called. (the one that takes a Context and a ScannerResult as parameters). This may present a problem because Delphi uses init as a method name for Java constructors, and XcBarcodeScanner has its own static method called init (which is not a constructor), so the JNI code may actually try and find a constructor method (and fail) rather than the actual method called init. I'm not sure if there's a solution for this yet, other than writing Java code of your own (that you would call from Delphi) that uses the XcBarcodeScanner class.

     

    Incidentally, I've managed to acquire the .jar file myself using information from the Github link you gave. 


  12. 2 hours ago, TTSander said:

    It's an SDK for connecting to the barcode scanner of MovFast-handhelds. I extracted the .jar-file from the supplied .aar file

    I've tried searching for this with not much success. Do you have a link?

×