Jump to content

Dave Nottage

Members
  • Content Count

    1546
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by Dave Nottage

  1. Dave Nottage

    Start application in system tray

    Please show your code. Also remember that the Visible property on TTrayIcon needs to be set to True
  2. Dave Nottage

    Start application in system tray

    Yes.. use a TTrayIcon component and set Application.ShowMainForm to False
  3. From the Android SDK? Android have not shipped the SDK Manager UI with the SDK for some time now. If you mean from Delphi, what do you see when you go to Tools | Options, Deployment > SDK Manager?
  4. Dave Nottage

    Android/IOS push notifications...

    You might have missed this part in my original answer: When using the default Delphi implementation, I expect the JSON will be missing the title and body members.
  5. The original installer is broken. If the PC does not have a compatible JDK already installed, it fails to install the SDK and NDK. This has been fixed somewhere between 11.3 and 12.2. The remedy with the "broken" versions is to install the JDK first, with no SDK/NDK, then use Tools | Manage Features to install the SDK/NDK, or install the compatible JDK even before installing Delphi.
  6. Dave Nottage

    Android/IOS push notifications...

    From the example message payload, this is the JSON from the DataObject in StartupNotifications: { "google.delivered_priority": "normal", "google.sent_time": "1735931915894", "google.ttl": "2419200", "google.original_priority": "normal", "google.product_id": "111881503", "body": "Example", "from": "\/topics\/FCMRebooted", "title": "Test", "com.google.firebase.iid.WakeLockHolder.wakefulintent": "true", "google.message_id": "0:1735931916503454%e6375accf9fd7ecd", "google.c.sender.id": "952580923416" }
  7. Dave Nottage

    Slow response on TButton click

    I've tested the same project using Delphi 12.2, deploying to an emulator running Android 8.1 (which is what the Sunmi D2 Mini shipped with), and all respond with the same speed. Perhaps someone with a real device might be able to confirm?
  8. Dave Nottage

    Android/IOS push notifications...

    There is on Android if you use the FCM implementation in Kastri, and send a "Data only" notification. By that, I mean the payload needs to look like this, for example: { "message":{ "topic":"FCMRebooted", "data":{ "title":"Test", "body":"Example" } } } Notice that there is no "notification" member. The same applies to when the application is running in the background. This will not work for the default implementation in Delphi, as it uses FCM's default handling for when the app is not running or in the background, which does not "look for" the data member.
  9. Dave Nottage

    Android/IOS push notifications...

    Yes, however you might want to assess why you need to do this at all. On Android, it's possible to handle a notification in code while the app is not running by using a service, as per the "RelayDemo" in FCMRebooted, except that instead of sending an SMS, the code could store the notification info in a text file as you suggest. On iOS, it's a completely different story - handling notifications in code when the app is not running requires that the notification is "silent" (using a content-available flag in the payload), and even then the OS can be extremely restrictive as to whether it will even execute the code.
  10. Dave Nottage

    Error Could not find program, C:\bin\\java.exe

    Start by uninstalling that version of AdoptOpenJDK (v21) and installing the correct version (v8). There is a direct link to it in the article I mentioned, i.e. this download link. It's also possible that you have other JDKs installed which are causing interference. Check the system Path variable and remove any others from it.
  11. Dave Nottage

    KastriFree FCMRebooted push notication firebase

    Sounds like there may be something wrong with the payload you are sending. You need to debug the SendPushNotificationNewVersion method to see what the value of LJSON is.
  12. Dave Nottage

    KastriFree FCMRebooted push notication firebase

    You have not included the Execute method implementation in the example. Also, you do not show how SendPushNotificationNewVersion is being called.
  13. Dave Nottage

    GPS and edgeBrowser

    Unless you use the Google Maps (JavaScript) API, I think you may need to live with the fact that the page "flashes".
  14. Dave Nottage

    GPS and edgeBrowser

    It might help to show the code you're using to do this.
  15. Dave Nottage

    Error Could not find program, C:\bin\\java.exe

    As per the installation notes, Delphi 10.4 requires AdoptOpenJDK 8. This article includes some instructions on how to install it. Please just focus on the part regarding AdoptOpenJDK. After it is installed, you'll need to change the Java part of the SDK settings in Delphi.
  16. Dave Nottage

    Slow response on TButton click

    It might help to indicate which version of Delphi. I have similar code that as far as I can remember worked OK on (real) devices with Android 8 or lower (using Delphi 12), however I no longer have access to them. It might also help to create a reproducible test case, in case someone else has such a device. I could try it out on an emulator, though.
  17. Dave Nottage

    Error Could not find program, C:\bin\\java.exe

    Is this happening only when attempting to generate an .aab (as opposed to .apk)? Please show what the Java settings are for your Delphi installation.
  18. Dave Nottage

    Anybody have Delphi running in a VM on M-series Mac?

    I can imagine that is the case. From (my sketchy) memory, I think I did investigate moving from an older VM, but in the end I started a new one. I tend to have as little installed on the VM as possible, so it wasn't difficult to bring one "up to speed" I have a Macbook Pro with an M1 Max, running a Windows 11 Arm VM (one with Delphi 12.2 and one with Delphi 11.3) using Parallels 20.1.1
  19. Dave Nottage

    Android/IOS push notifications...

    If the app is not already running, you need to handle startup notifications. See part 10 of these instructions, which deals with handling the StartupNotifications property.
  20. Dave Nottage

    Google Pay and Apple Pay

    Not sure what you mean by "more" stable, if an out of the box solution does not exist? In any event, TMS PassKit is for VCL, and deals with PassKit files, not PassKit itself.
  21. Dave Nottage

    Google Pay and Apple Pay

    Yes Judging by the documentation for Wallet and PayButton, I expect it will be a bit more involved, but yes. If by "wrapper" you mean "Delphi code that uses PaymentsClient", then yes 🙂 Perhaps the GoogleSignIn feature might come closest, however they're all fairly diverse (check units that end with .Android.pas in the subfolders of the Features folder). I expect using PaymentsClient (and the Wallet class) may be more complex than the others.
  22. Dave Nottage

    Google Pay and Apple Pay

    I've done something similar for the AppleID button, here and here, and I suspect PKPaymentButton will be similar. You'll need an import for PassKit, too. As for the PayButton from Google, you'll need to get the play-services-wallet package (which means obtaining any dependencies not already in the "default" jars in Delphi), then import the relevant classes before creating the same kind of code as for PKPaymentButton, but for the PayButton, for Android, as well as writing the code that uses the PaymentsClient class.
  23. Dave Nottage

    MACOS "setDesktopImageURL"

    This should be: Options := TNSMutableDictionary.Create; This should be: Options.setObject(TNSColor.OCClass.whiteColor, NSObjectToID(NSWorkspaceDesktopImageFillColorKey)); Since setObject takes pointer parameters, for both. The rest should follow the same rule. Incidentally, there's loads of examples of using an NSMutableDictionary in the Delphi source (as well as in Kastri)
  24. Dave Nottage

    MACOS "setDesktopImageURL"

    I did? 🙂 This code works for me: procedure SetDesktopBackground(const ImagePath: string; const FillColor: TAlphaColor); var NSFileURL: NSURL; NSWorkspace1: NSWorkspace; MainScreen: NSScreen; LPointer: Pointer; Error: NSError; begin try // Convert Delphi file path to NSURL NSFileURL := TNSURL.Wrap(TNSURL.OCClass.fileURLWithPath(StrToNSStr(ImagePath))); NSWorkspace1 := TNSWorkspace.Wrap(TNSWorkspace.OCClass.sharedWorkspace); MainScreen := TNSScreen.Wrap(TNSScreen.OCClass.mainScreen); LPointer := nil; // Set the desktop image for the main screen if not NSWorkspace1.setDesktopImageURL(NSFileURL, MainScreen, nil, @LPointer) then begin Error := TNSError.Wrap(LPointer); ShowMessage('Failed to set desktop image: ' + NSStrToStr(Error.localizedDescription)); end; except on E: Exception do begin ShowMessage('Error setting desktop image: ' + E.Message); end; end; end; If you're having trouble creating a dictionary for the options, please show what code you attempted.
  25. Dave Nottage

    Android short time format 24h/12h

    The method name is24HourFormat, not is24hourformat, and is also a static method, so the declaration should be: JDateFormatClass = interface(JObjectClass) ['{E9A75876-EDA1-44CE-B159-46BACF1805F7}'] {class} function is24HourFormat(context: JContext): Boolean; cdecl; end; [JavaSignature('android/text/format/DateFormat')] JDateFormat = interface(JObject) ['{65E305D7-04D6-4C33-8AB0-9FE366F3F24D}'] end; TJDateFormat = class(TJavaGenericImport<JDateFormatClass, JDateFormat>) end; ..and called like this: uses Androidapi.Helpers; procedure TForm1.FormCreate(Sender: TObject); begin if TJDateFormat.JavaClass.is24HourFormat(TAndroidHelper.Context) then // is 24 hour else // is 12 hour end; Note that I have not tested the code above - I am just going by the documentation (which I linked to)
×