Jump to content

Dave Nottage

Members
  • Content Count

    1613
  • Joined

  • Last visited

  • Days Won

    37

Posts posted by Dave Nottage


  1. 4 hours ago, Ranja AZ said:

    can I convert this java file to .pas file with this tools?

    Unlikely. Such tools are to create imports from .jar or .class files, not convert Java code to Delphi. 

    Your main problem will be whether OnPrintListener is a class or an interface, because you cannot implement a descendant of a Java class in Delphi - it needs to be done in Java. Java interfaces however, can be implemented in Delphi by creating a descendant of TJavaLocal, and implementing the interface in question. There are a number of examples of descendants of TJavaLocal throughout the Delphi source.

     

    In order to determine what OnPrintListener is, you could use the aforementioned tools to import the Java classes from the .jar that you mentioned, assuming that it is the one that contains com.nexgo.oaf.apiv3.


  2. 3 hours ago, Halcon said:

    I can't find any method for save and get images that can view on the phone gallery

    Since iOS 8, use the PhotoKit framework to access photos in albums:

     

      PhotoKit | Apple Developer Documentation

     

    I have an import for it, here: 

     

      https://github.com/DelphiWorlds/Kastri/blob/master/API/DW.iOSapi.Photos.pas

     

    Which likely needs updating, because I think I imported it around iOS 9 era. This will not help you however, if you are saving photos as files somewhere. You can retrieve the filename from an asset in the gallery, bearing in mind can be traps in doing so: 

     

      https://medium.com/@slk11075/traps-for-phasset-how-to-get-filename-from-phasset-67d856e75c64

     

    • Like 2
    • Thanks 1

  3. 1 hour ago, Beppe Magistro said:

    these variables remain in red , may be are not more defined in 

     

    FMX.PushNotification.Android;

    Are you actually including that unit in your source? If so, where you have declared it, please use Ctrl-Click or right-click and Open File At Cursor. It should find it in the Delphi source in the fmx folder. If it finds it anywhere else, that's probably the issue.


  4. 3 hours ago, Beppe Magistro said:

    up

    You didn't answer my other question, i.e:

     

    On 12/22/2020 at 11:39 PM, Beppe Magistro said:

    Have you checked to see if PushService is non-nil when executing this line?

    
    
    ServiceConnection := TPushServiceConnection.Create(PushService);   

     

     

     


  5. 37 minutes ago, zburns said:

    Attached a sample project that demonstrates the link

    The test project:

    Does not have "Secure File Sharing" checked in the Entitlements section of the Project Options,
    Does not request the required permissions at runtime.

    Fixing these makes it work for me on Android 11.


  6. 3 hours ago, Alfredo Silvano said:

    The app sometimes fails to start and the debugger doesn't even execute the first line of code in the dproj file.

    On Android, problems in deployment can cause the app to fail to start, however you have indicated it is also a problem on iOS, so it is more likely to be a problem with the initialization of one of the units included.

     

    Can you create a blank app that runs OK? If so, use that, and start adding your original to the project until it breaks - then you have a reproducible example.

    • Thanks 1

  7. 2 hours ago, Dave Nottage said:

    SetMaxImage and SetMinImage are not being called when the component is being loaded

    Which is the whole problem - they're not called when the values are streamed. I needed to override the Loaded method to see that they are.


  8. I have an FMX component with a published TBitmap property, but the property is not being read when the component is loaded (the other properties are).

     

    Holger Flick's article suggests that it is possible: https://flixengineering.com/archives/166

     

    Is there something special I need to do to make it work? This is what the declaration looks like:

     

      TCustomNativeDoodad = class(TPresentedControl)
      private
        function GetMaxImage: TBitmap;
        function GetMinImage: TBitmap;
        function GetModel: TCustomNativeDoodadModel; overload;
        function GetValue: Single;
        procedure SetValue(const Value: Single);
        function GetOnValueChange: TNotifyEvent;
        function GetOrientation: TDoodadOrientation;
        procedure SetMaxImage(const Value: TBitmap);
        procedure SetMinImage(const Value: TBitmap);
        procedure SetOnValueChange(const Value: TNotifyEvent);
        procedure SetOrientation(const Value: TDoodadOrientation);
      protected
        function DefineModelClass: TDataModelClass; override;
        function RecommendSize(const AWishedSize: TSizeF): TSizeF; override;
      public
        constructor Create(AOwner: TComponent); override;
        property MaxImage: TBitmap read GetMaxImage write SetMaxImage;
        property MinImage: TBitmap read GetMinImage write SetMinImage;
        property Model: TCustomNativeDoodadModel read GetModel;
        property Orientation: TDoodadOrientation read GetOrientation write SetOrientation;
        property Value: Single read GetValue write SetValue;
        property OnValueChange: TNotifyEvent read GetOnValueChange write SetOnValueChange;
      end;
    
      [ComponentPlatformsAttribute(pfidiOS or pidAndroid)]
      TNativeDoodad = class(TCustomNativeDoodad)
      published
        property Align;
        property Anchors;
        property Height;
        property Margins;
        property MaxImage;
        property MinImage;
        property Orientation;
        property Position;
        property Size;
        property Value;
        property Visible default True;
        property Width;
        property OnValueChange;
      end;

    SetMaxImage and SetMinImage are not being called when the component is being loaded


  9. 2 hours ago, TrevorS said:

    I noticed that 10.4 had received a patch so I thought I'd create a fresh install (Windows and Delphi).

    If you installed Delphi from scratch, you'll still need to apply the patches (there's 4)

    2 hours ago, TrevorS said:

    However, I can't add an SDK for OSX ... nothing is displayed in the SDK manager.

    In a Terminal window on the Mac, can you run this command?

    /usr/bin/xcodebuild -version -sdk

    In the output there should be at least one entry of MacOSX


  10. 8 hours ago, Beppe Magistro said:

    program hang when execute

    What do you mean by hang? Have you checked to see if PushService is non-nil when executing this line?

    ServiceConnection := TPushServiceConnection.Create(PushService);   

     


  11. 7 minutes ago, Beppe Magistro said:

    TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.GCM)

    Please pay attention to compiler warnings. TPushService.TServiceNames.GCM has been deprecated. Use TPushService.TServiceNames.FCM


  12. 8 hours ago, meshael said:

    However, in my case, there are 20 different subfolders. And the remote path must match. So for each file I have to edit the remote path. It it still quite a bit of editing.

     

    You could use Grijjy's DeployMan tool - it makes this process a lot easier. They describe it in this article:

     

      https://blog.grijjy.com/2017/01/30/embed-facebook-sdk-for-android-in-your-delphi-mobile-app-part-2/

     

    In the section titled "Add the resources to the Delphi Deployment Manager for your Android project"


  13. 5 hours ago, meshael said:

    Where can I find some documentation on using Mosco

    That's something I need to do. There's basic help for the "MonkeyBuilder" edition, and virtually zero for the "full" version which is in beta. I'll make sure I can help while working on some doc.

    5 hours ago, meshael said:

    The install of Mosco itself was very nice and I can see some of the features there. I am excited to explore it.

    The installer for Mosco itself actually just the standard .pkg format, created with the pkgbuild command: https://www.manpagez.com/man/1/pkgbuild/

     

    I may look into using some of the options in order to make creating installers more customisable


  14. 1 hour ago, eg1 said:

    Cannot call Java instance methods called "init"

    Were there any particular classes that apply to you for that bug?

    1 hour ago, eg1 said:

    Apparent bug in linker (ld) when using Facebook Audience Network on iOS

    Well, as you can see, I share your pain with that particular one 😉

     

×