Jump to content

Dave Nottage

Members
  • Content Count

    1335
  • Joined

  • Last visited

  • Days Won

    29

Posts posted by Dave Nottage


  1. 2 hours ago, Joe Sansalone said:

    And the code to make audio play worked on previous iOS.

    Which version of iOS? Do you have a test project that reproduces the problem?

    2 hours ago, Joe Sansalone said:

    Could the SDK/device iOS version mismatch be the problem?

    In this case, it's unlikely. I'm working with iOS SDK 15.0 on 15.3 devices, including playing audio. 

    I know this sounds a bit bone-headed, but also check that your mute button is not switched. I've actually done that myself 🙂


  2. On 2/6/2022 at 6:34 PM, Levente said:

    First, I deleted the iOS SDK in the Delphi SDK manager, then I also deleted it from the hard drive, and then I added the iOS SDK to Delphi again.

    You may also need to delete any cache-xxxxxx folders under PAServer/scratch-dir on the Mac, then import


  3. I've found some code from an older repo (namely https://github.com/ccy/jedi-apilib) for what I want to achieve however I'm having trouble making it work. This is the code in question:

     

    const
      WTS_CURRENT_SERVER_HANDLE = 0;
      WTS_CURRENT_SESSION = DWORD(-1);
      
    type
      _WINSTATION_REMOTE_ADDRESS = record
        AddressFamily: DWORD;
        Port: WORD;
        Address: array [0..19] of Byte;
        Reserved: array[0..5] of Byte;
      end;
      PWINSTATION_REMOTE_ADDRESS = ^_WINSTATION_REMOTE_ADDRESS;
      TWinStationRemoteAddress = _WINSTATION_REMOTE_ADDRESS;
      PWinStationRemoteAddress = PWINSTATION_REMOTE_ADDRESS;
    
    function WinStationQueryInformation(hServer: THandle; SessionId: DWORD; WinStationInformationClass: Cardinal; pWinStationInformation: PVOID;
      WinStationInformationLength: DWORD; var pReturnLength: DWORD): Boolean; stdcall;
      external 'winsta.dll' name 'WinStationQueryInformationW';
      
    function GetWVDClientAddress: string;
    var
      LBytesReturned: DWORD;
      LRemoteAddress: _WINSTATION_REMOTE_ADDRESS;
    begin
      LBytesReturned := 0;
      ZeroMemory(@LClientAddress, SizeOf(LClientAddress));
      if WinStationQueryInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WinStationRemoteAddress, @LClientAddress, SizeOf(LClientAddress), LBytesReturned) then
      begin
        // Do something with LClientAddress here
      end
      else
        Result := SysErrorMessage(GetLastError);
    end;

    The call to WinStationQueryInformation is failing, and the message being returned by SysErrorMessage is: "The tag is invalid".

    Is there something obvious that I'm missing?


  4. 3 hours ago, AVG said:

    Do anyone know how or we are pre-configured this automatic value that Delphi adxs to the Manifiest when you select that you want to integrate with Firebase?

     

    As you discovered, it is being added during the build process. The value for exported is not in any configuration files so presumably it is hard-coded. The "easiest" way to fix this is to edit the generated AndroidManifest.xml, add it to the deployment and disable the one that Delphi would normally deploy. Of course this means having to repeat the process if you make any changes that affect the manifest.

     

    ..or you could use Delphi 11, where the problem has been fixed.

    • Like 1

  5. 12 hours ago, param said:

    Please let me know your input/views on this

    If you haven't installed either the November or January patch, install that, then re-import the iOS SDK.


  6. 4 hours ago, angusj said:

    That seems likely be the solution to Dave Nottage's problem

    I'd like to know how it is the likely solution. Please refer to the original question.

    29 minutes ago, Anders Melander said:

    Well, the answer to his question is "yes" but since we don't really know what problem he's trying to solve it's hard to tell

    The problem I am trying to solve is in the original question. The "why" is that a WVD app is on the receiving end of the drag operation, and the virtual channel needs to register the WVD app window for drag/drop. The best time to do this is at the start of the operation. As I say, this has been working famously for standard drag/drop, but it does not work for dragging attachments out of Outlook


  7. This answer has served me well for some time now:

      https://stackoverflow.com/a/13835244/3164070

     

    however it does not work for when a user drags an attachment from Outlook (it works when dragging the entire email). Does anyone know if an object of a different name is created, or perhaps some other "event" occurs? I'm otherwise looking at installing a global mouse hook as @Remy Lebeau suggests in one of the other answers in the same SO post.


  8. If you're using the original project, follow the steps here to ensure that it has references to the correct Android libraries: https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AndroidLibraries

    Delete the original AndroidManifest.template.xml, making sure you note any customizations you added yourself. Recompiling the project should recreate the AndroidManifest.template.xml file and you can add any customizations back in. I suspect the error messages you were seeing when you tried compiling with Delphi 10.4 may have been related to having an older AndroidManifest.template.xml.

     

    Assuming that you had not changed the %targetSdkVersion% part of AndroidManifest.template.xml, you will find that your app will now need to request permissions for "dangerous" permissions at runtime, so you will need to modify your code to suit. There's examples of how to do this in demos like in the camera component demo: https://github.com/Embarcadero/RADStudio11Demos/tree/main/Object Pascal/Mobile Snippets/CameraComponent and the location demo: https://github.com/Embarcadero/RADStudio11Demos/tree/main/Object Pascal/Mobile Snippets/Location

     

    If you opted to install the Android SDK/NDK files when you installed Delphi 11, when you add an SDK, it should default to the compatible values anyway.

     


  9. 9 minutes ago, kaarigar said:

    I was curious because sync dialogs are supported on other platforms.

    I can understand that async dialogs are a concept that can be a challenge to embrace. Some time in the future we'll all be wondering why 😉

     

    • Like 1

  10.  

    3 hours ago, kaarigar said:

    Documentation says that the modal dialogs are not supported on android

    There's a good reason for that - implementing modal dialogs on Android the same way as on Windows is practically impossible.

    3 hours ago, kaarigar said:

    and was looking for a work around way or technique to have it on android

    The workaround is to use async dialogs. Developers do this on Windows all the time - from one form, show another. When the user takes some action on the secondary form, do something based on that action, and close the form. The primary form will still be there when they get back 🙂 

     

    If the primary form needs to "know" what happened on the secondary form, you could expose a property or event handler on the secondary form which the primary form can examine, or handle.

    • Like 1

  11. For Android, this is the only way I've found that will quit completely and remove the task from the "recent items" list:

     

    https://github.com/DelphiWorlds/Kastri/blob/64a5600e0845862f3e3991cd1708dee82a65ff45/Core/DW.Android.Helpers.pas#L561

     

    For iOS, it's bound to have your app rejected if it is on the App Store, otherwise:

     

    https://developer.apple.com/library/archive/qa/qa1561/_index.html

     

    • Like 2
    • Thanks 2
×