Jump to content

Dave Nottage

Members
  • Content Count

    1608
  • Joined

  • Last visited

  • Days Won

    36

Posts posted by Dave Nottage


  1. 7 minutes ago, MMSoft said:

    But how can I ask whether this Permission has been given ?

    With this:

    uses
      Androidapi.JNI.Os;
    
    LHasAccess := TJEnvironment.JavaClass.isExternalStorageManager;

    Note that this applies from Android 11 onwards only, so you should use TOSVersion.Check(11) to determine whether or not to manage that permission


  2. 16 minutes ago, ToddFrankson said:

    Still having issues getting the App Icon Using the following:

    As I mentioned in my first reply, you could use the code from TNotificationCenterAndroid.CreateNativeNotification as an example. Inside that is this:

      function GetDefaultIconID: Integer;
      begin
        Result := TAndroidHelper.GetResourceID('drawable/ic_notification');
        if Result = 0 then
          Result := TAndroidHelper.Context.getApplicationInfo.icon;
      end;

     


  3. On 11/10/2024 at 5:16 AM, ToddFrankson said:

    How do I make my App stay like that in the notification panel

    You'd need to create the notification using the underlying classes, since the notification implementation in Delphi is yet to support "sticky" notifications. You could use the code in the TNotificationCenterAndroid.CreateNativeNotification method in rtl\common\System.Android.Notification.pas as a guide, and use the setOngoing method to make it "sticky".

     

    It's not exactly clear from your post what else you need solved.

    • Like 1

  4. 1 minute ago, KimHJ said:

    Exception class EJNIFatal with message 'Java type recieptservice/com/recieptservice/PrinterInterface could not be found'

    That usually means you have not added the required .jar file (the one you ran Java2OP on) to the project. In Project Manager:

    1. Expand the Android 32-bit target
    2. Right-click on Libraries
    3. Click Add..
    4. Select the .jar file
    5. Click OK

    Note that the .jar will be compiled in regardless of whether you compile for 32-bit or 64-bit.


  5. A client has well established products that are based around the MDI model, and are using the concept of "desktops" by hiding/showing MDI children so that the state of the forms is maintained. The concept of hiding MDI children is actually not officially supported in Delphi, so to work around this, ShowWindow is called thus:

        ShowWindow(FormHandle, SW_SHOW);
    // or
        ShowWindow(FormHandle, SW_HIDE);

    ..where FormHandle is the handle of the MDI child being shown/hidden. This worked well, up until Delphi 12, when the message handling for forms was reimplemented, using TChildFormMessageHandler (in Vcl.Forms). The new (undesired) behaviour is that once a child form has ShowWindow called on it, then that form becomes active, the last form that was hidden becomes visible again. This can be reproduced using the attached project by using the following steps:

     

    1. Run the app
    2. Click File | Show Desktop 1
    3. Click File | Show Desktop 2
    4. Click File | Show Desktop 1 again
    5. Set focus to the visible form - the form that "belongs" to Desktop 2 becomes visible again 

     

    As described above, this works OK in Delphi 11.3. At this point, reimplementing the app away from MDI is a non-option. I'm aware that whatever measures are needed will be a "hacky" workaround - it started out that way anyway.

    Now for the kicker: this is a package-based application, so I can't even "hack" the Vcl.Forms source. Using a "detours"-like solution might be an option.

    Any help with how to resolve this would be greatly appreciated.

    MDIIssue.zip


  6. 5 minutes ago, johnnydp said:

    Anyone knows if EMB plans are for 12.3 maintenance bug fixing focused release or we wait for 13 (or skip unlucky no.) and go to 14.

    No mention of a 12.3, however in a webinar (I think the one for 12.2) they said 13 would not be skipped.

    • Like 1

  7. On 3/5/2021 at 5:09 AM, Beppe Magistro said:

    there is in delphi 10.4.2 a way to understand if MAC is in dark mode and switch theme ?

    Not sure if you are still using 10.4.2, or if this will compile in 10.4.2, but:

    function IsDarkMode: Boolean;
    var
      LStyle: string;
      LDefaults: NSUserDefaults;
    begin
      LDefaults := TNSUserDefaults.Wrap(TNSUserDefaults.OCClass.standardUserDefaults);
      LStyle := NSStrToStr(LDefaults.stringForKey(StrToNSStr('AppleInterfaceStyle')));
      Result := False;
      if LStyle.Equals('Dark') then
        Result := True;
    end;

     


  8. 3 hours ago, Vanar said:

    But I need to run it on iOS

    Why do you need to send push messages from an iOS device? It's a very bad idea to have private key info in an iOS app. In a web server (where messages should be sent from), the executable (and private key) is (or at least should not be) accessible externally.

    3 hours ago, Vanar said:

    How do I use Firebase SDK for IOS 6.28,
    where can I download Firebase SDK (GetIt doesn't work for me for some reason),

    From here: https://github.com/firebase/firebase-ios-sdk/releases/download/CocoaPods-6.28.0/Firebase.zip
    ..but the code example above which sends messages does not require the iOS SDK, which is used for receiving messages.

    • Like 1

  9. On 10/16/2024 at 8:54 PM, John van de Waeter said:

    But both 11.2.0 as 11.3.0 give me an error when I try to unzip them: Invalid Zip-file. Tried on both win10 and win11.

    A follow-up to this: I have contacted their support team, who requested that I provide a video demonstrating the problem 🙄. I have since replied, asking them if they really are incapable of doing two simple steps (Using Windows: download, and try to open) to replicate it themselves.


  10. 6 hours ago, John van de Waeter said:

    Yep, lots of other code in this file. But it contains the original firebase.zip, which in turn has the same problem....

    Both unzip OK on macOS, so I tried to "re-zip" the 11.2.0 version on Windows, but that causes Explorer to crash 😞

     

    I've asked a question about it in their Slack workspace, since all the other reporting mechanisms don't seem to cover this category.


  11. On 9/14/2024 at 6:34 PM, Nicolò Blunda said:

    Many devices (Tablet) appear NOT compatible in GooglePlay

    What is the exact message from Play Store?

    On 9/14/2024 at 6:34 PM, Nicolò Blunda said:

    Lenovo Tab P11 2nd gen. is compatible, Lenovo Tab P11 PRO 2nd gen is not...

    Seems rather odd.

    On 9/14/2024 at 6:34 PM, Nicolò Blunda said:

    It is a targetSdkVersion problem?

    Both of those ship with Android 12 - do they both have Android 12 now?


  12. On 10/4/2024 at 4:02 PM, Rollo62 said:

    NativeView := WindowHandleToPlatform(AControl.Handle).View;

    This part will not even compile. TControl does not have a Handle property in FMX.

    On 10/4/2024 at 4:02 PM, Rollo62 said:

    NativeView.setContentDescription(StringToJString(ADescription));

    Nor will this. setContentDescription takes a JCharSequence as the parameter.

    The main problem is that "non-native" FMX controls do not have an underlying native control, except when ControlType is Platform. Even then, there is no support for calling setContentDescription on that native control. This would require adding a ContentDescription property to TControl so that it can be passed to the underlying "native" controls. On top of this, only certain controls on Android support ControlType of Platform.

×