Jump to content

Hans♫

Members
  • Content Count

    118
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Hans♫

  1. Windows 10, latest version. I have updated my post.
  2. This could also be due to differences in hardware and configuration. How many devices have you tested for each Android version?
  3. Ok, I use 10.4.2 (27.0.40680.4203 ), but most important: the problem is there in the latest Delphi 11.
  4. If you close the modal window with the red button in the title bar, then FormClose and FormCloseQueury are not called on MacOS. However, this problem was also there in Delphi 10.4, so it might not be the same issue you are facing. I recently reported this bug here: https://quality.embarcadero.com/browse/RSP-39547
  5. Hans♫

    TDialogService.MessageDialog translation

    We have made the "SetSystemText" function below, to replace the hardcoded dialog strings. It works on all platforms including iOS and Android (thought we have had problems with only a partial implementation in MacOS in previous Delphi versions - not sure if it has been fully implemented yet). It is a part of our own language handling class, but the idea is that fLines is a list of text lines loaded from a language file, where the ID is defined by a constant. Just replace this with your own source of translations. The "LoadLangFromStrings" procedure is in FMX.Types. procedure tProgStr.SetSystemText; var lStrList: TStringList; begin //Load list of translations for use everywhere the "Translate" function is used in Delphi. lStrList := TStringList.Create; lStrList.AddPair(SMsgDlgInformation, fLines[cStrInformation]); lStrList.AddPair(SMsgDlgError, fLines[cStrError]); lStrList.AddPair(SMsgDlgConfirm, fLines[cStrConfirmation]); lStrList.AddPair(SMsgDlgWarning, fLines[cStrConfirmation]); //<- We don't have the "Warning" text translated lStrList.AddPair(SMsgDlgYes, fLines[cStrYes]); lStrList.AddPair(SMsgDlgNo, fLines[cStrNo]); lStrList.AddPair(SMsgDlgCancel, fLines[cStrCancel]); lStrList.AddPair(SMsgDlgClose, fLines[cStrClose]); lStrList.AddPair(SMsgDlgOK, fLines[cStrOk]); lStrList.AddPair(SMsgDlgHelp, fLines[cStrHelp]); lStrList.AddPair(SMsgDlgHelpHelp, fLines[cStrHelp]); LoadLangFromStrings(lStrList); lStrList.Free; end;
  6. We have a few users that experience freezing and very slow response in our Android App. In Google Play Console, we get these ANR messages: The app works on 99% of the devices, so it is not a general problem, and we cannot reproduce it on our devices. What can be the reason for these problems? Another user has posted a StackOverflow question about this a year ago - but no answers: https://stackoverflow.com/questions/66657413/how-to-solve-anr-on-android-firemonkey PS. Could it be related to this warning ("Non-SDK API: Landroid/view/MotionEvent") that we also have? https://stackoverflow.com/questions/70350726/delphi-11-app-in-android-play-store-shows-warning-non-sdk-api
  7. Thanks Dave! To achieve the best user experience we would like to use the install-time assets. We need to extract a 150 MB binary file to be accessed using traditional file methods, and had hoped that your demo app also supported install-time assets. As you mention, the only part missing is to extract and save the file using AssetManager. Any chance that this could find it way into your demo project?
  8. Hi Dave, Thanks for your reply, it's greatly appreciated. Now Video1 and Video3 get downloaded when adding the call to FAssetDelivery.Fetch in the IdleMessageHandler. So the fast-follow & on-demand delivery modes both work correctly. And the videos are playing as well. However, the install-time asset Video2 still does not show up. But I wouldn't have expected that the above fix would have solved that either. You write in the code: //!!!! Install time packs are just "normal" assets Do you see Video2 showing up in your app? Maybe I'm wrong but as I read the android developer documentation the install-time asset pack will be available immediately at app launch, but that's only the apk and you need to access the assets in it thru the AssetManager API. See this diagram. I assume the solution in our case could be to use AssetManager API stream interface to make a copy of the file in a temporary location. Do you agree? Thanks again for your help!
  9. Hi Dave I've managed to successfully build and install the AssetDeliveryDemo. Building/deploying the Android 64bit Release Application Store target with Asset Packs (Build.. and Install using the Codex 1.5.1 Tools) using our own keystore. However, when running the AssetDeliveryDemo App on the device, only an empty startup screen is displayed, e.g. I don't see any Assets (expecting 3 video files). I've investigated the system log and see info "FMX: AssetDeliveryDemo: Asset pack: ondemand_assetpack required space: 2MB..." info "FMX: AssetDeliveryDemo: Asset pack: fastfollow_assetpack required space: 1MB..." Meaning the AssetDeliveryAssetPackStateUpdateHandler is called with TAssetPackAction:TAssetPackAction.Query for both the fastfollow and ondemand asset packs However, no further calls are coming thru to the AssetDeliveryAssetPackStateUpdateHandler. Further I've investigated the app filesystem and in the base directory there's an "split_installtime_assetpack.apk" asset pack with the other split apks etc., but the content (video file) has not been extrated to /files as expected. I've tried calling the FAssetDelivery.GetAssetPackPath('installtime_assetpack'), however, it only returns an empty string since FAssetPackManager.getPackLocation is nil For our app we only interested in using the installtime asset, so I've incorporated this in our app and building that asset into our bundle and get the same results. Meaning the "split_installtime_assetpack.apk" is placed in to base directory and contains the asset, but it's not extracted. Note, I've tried both building the app bundle with the automatic (codex) tools and manual scripts This version of the app bundle has also been uploaded and installed from Google Play Store to test if it was only a problem in local-testing mode, but the result is the same. My Configuration RAD Studio 11 Patch 1 Android SDK \Embarcadero\Studio\22.0\CatalogRepository\AndroidSDK-2525-22.0.42600.6491\platforms\android-30 NDK \Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.42600.6491\android-ndk-r21 Java tools from Android Studio 2020.3.1 Patch 3
  10. Hi Dave, Thanks, and of course I should have checked your Kastri library of additional implementations. I guess I didn't find it because I was only searching for "Play Feature Delivery", and not for "Play Assets Delivery", which Google describe as being ONLY for games. However, having read more details about it, I think it matches our needs perfectly well. So I'll look further into your demo.
  11. It works with Delphi 🙂 Just received the Mac Mini with the new Apple M1 CPU. After a quick attempt to deploy our FMX app, I can confirm that PAServer runs and I can deploy and run our FMX app without problems. "Rosetta 2" seems to do the job very well!
  12. Having various components on a TListbox, scrolling does not work when i touch a component that has HitTest=True. What is the best way to solve this? I have comboboxes, radiobuttons, checkboxes, etc on Listboxitems to create a dynamic interface. So far I have only used native components on iOS (TMS iCL) where scrolling vs control interaction, is handled automatically by the OS in a very smooth way. Now we are preparing an Android version based on our FMX view, but on FMX it does not seem to work out of the box. If HitTest is true for a component, then scrolling does not work, and if HitTest is false for a component, then it does not respond, but scrolling works. I found this nice solution made by David Nottage, but it requires to create a descending class of each component used: https://stackoverflow.com/questions/57452568/prevent-firing-events-while-scrolling-tvertscrollbox
  13. I found the reason for the problem: Delphi handles touch events by ownership and not by parentship. Scrolling only works for scrollboxes OWNED by the mainform. It is not enough that that the mainform is their parent. In my situation my ownership looks like this: MainForm>TLayout (the layout animates the showing of other "windows") In another unit I have: MyFrame>TRectangle>TRectangle>TListBox Now when I want to show the content of the Frame, I Create the frame with the Application as the owner, and set the parent of the root Rectangle to the TLayout of the mainform, to slide it in. With this structure, scrolling does NOT work. However, if I create MyFrame with the MainForm as the owner, then it works!
  14. Thank you for your reply. If thats true, then there must be something in my setup that causes the default behavior not to work. I wonder what that is? My parentship hierachy looks like this: MainForm>TLayout>TRectangle>TRectangle>TListBox>TListBoxItem>TRadioButton When I set HitTest=true for the RadioButton, then touch scrolling of the listbox only works if I touch outside the Radiobutton. If I touch the radiobutton then it selects the radiobutton, but scrolling does not work. I have no Gesture manager assigned and no InteractiveGestures selected.
  15. Thank you, but it seems to be a solution similar to the one I refer to? I prefer not to have a custom edition of each components placed on the Listbox. However, I also realize that both solutions relies on that scrolling actually does work when tapping a control, but it does not work for me. As soon as Hittest=true for the control on the listbox, then it does not scroll at all when I touch that control.
  16. Hans♫

    Low-level audio on Android?

    It looks like the Oboe library is the way to go for low-level audio input/output on Android. But it's a C++ library, so it will require writing a wrapper to flatten it. Do you know anyone using Oboe in Delphi, that might have written a full or partial wrapper? PS. I am usually a little afraid to share my own wrappers on various platforms because they are usually only partially completed and I fear that I also have to provide support for it, and instruct how to use it 😉. However, anything you have would be a great help 🙂
  17. I have used SDKtransform for years (executed through "SDK Transform Assistant") to implement the iOS and OSX frameworks that are not included with Delphi. However, an increasing number of classes fail to be converted and are not included in the output .pas header file. Right now I need to convert AVAudioEngine from AVFoundation in MacOS 11 (Big Sur), but SDKtransform fails with a lot of these lines added to the log: "WARN: cannot add ObjCInterface AVAudioEngine - base class unknown" Could this be due to the way it is defined (as an interface)? API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) @interface AVAudioEngine : NSObject { @private void *_impl; } - (instancetype)init; - (void)attachNode:(AVAudioNode *)node; - (void)detachNode:(AVAudioNode *)node; ... @property (readonly, nonatomic) BOOL isInManualRenderingMode API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0)); ... @end // AVAudioEngine How do I autoconvert this type of header definitions? PS. This is a copy of my post on StackOverflow.
  18. Hans♫

    Delphi and the new Apple M1 CPU

    I have not seen any yet. Where do you experience problems? Maybe. There is a chance that you could implement debugging without offering arm as a target, but I suppose it would rely on the Rosetta 2 emulator, if that implements mapping of instructions and memory for debugging purpose. With the limited development ressources that Embarcadero can put into it, we are probably not seeing debugging support for the M1 until they make a full support of the M1 ARM target.
  19. Hans♫

    Delphi and the new Apple M1 CPU

    No it still doesn't work, and I realize I forgot to create an issue about it. Now it is there: https://quality.embarcadero.com/browse/RSP-32362
  20. Hans♫

    Delphi and the new Apple M1 CPU

    I have no performance numbers, but it "feels" faster. Apps starts faster and feels more responsive, but maybe it is also related to being a new and fresh installation of MacOS, compared to a 3 years old Mac Mini with Intel.
  21. I have a Mac Mini with M1 CPU. You can run PAServer on it and deploy Delphi MacOS apps on it, but you cannot debug. So as long as you choose "Run without debugging", then it works fine. See also this post:
  22. Hans♫

    Delphi and the new Apple M1 CPU

    The roadmap refers to ARM M1 as a target platform. What I am referring to is to be able to debug the Intel target on an ARM M1 CPU. I can deploy and run from Delphi on the M1 CPU, but I cannot debug. It might not be possible to use the CPU view in Delphi, as it would have to work through the Rosetta 2 converter, but limited debug facilities would suffer, e.g. Breakpoints and variable inspection.
  23. Hans♫

    Delphi and the new Apple M1 CPU

    Now I had time to investigate it a bit further. Looks like debug mode does NOT work on the new M1 CPU. I can run a MacOS application from Delphi on the M1 Mac, without debugging, but when I run in debug mode I get the error: "unable to create process 'debug kernel timeout'". The same application runs fine in Debug mode when using an Intel Mac having the same versions of MacOS (Big Sur) and XCode. Before I create an issue on on Quality Portal. Are there any suggestions for things I should try first? - or extra information I can retrieve and include in the issue?
  24. Hans♫

    AV with InApp purchase on MacOS

    The FMX.InAppPurchase component already implements in-app purchase for iOS, and since OSX uses the same StoreKit library, I simply added an OSX copy of the iOS implementation and adjusted it to "work" on OSX. It works as far as it compiles and runs, and I can call "QueryProducts", which also initiates a Delegate callback. Once in a while I can even successfully read the product details from App Store that I receive in the callback, but most of the time the callback fails with an AV. It seems to be random where it fails. If I restart paserver before each run I can increase the chance that it works, but except from that I did not find any correlation between changes I have made and a successful request. The testprogram works fine on iOS. On OSX I have tried to target both Mojave and Cataline, and both 32 bit and 64 bit editions. They all fail. As the OSX code is the same as the iOS code, I guess that the problems are related to differences between the iOS and the OSX target in the Objective-C handling and wrapping. Any ideas what could be wrong, or what I should try? (or maybesomeone with more knowledge about Objective-C wrapping and the inner workings of Delphi could help me with this?) Below are some extracts from the code in my new unit "FMX.InAppPurchase.Mac". My test program creates TiOSInAppPurchaseService and call QueryProducts. It works without errors, and a few seconds later the TiOSProductsRequestDelegate.productsRequest callback is called. From here random AV's happens. Usually it fails on the first line FIAPService.FProductList.Clear, and sometimes it fails earlier in "DispatchToDelphi" or later in one of the following lines. TIAPProductList = class(TList<TProduct>) end; procedure TiOSInAppPurchaseService.QueryProducts(const ProductIDs: TStrings); var ProductIDsArray: NSMutableArray; ProductIDsSet: NSSet; ProductID: string; begin ProductIDsArray := TNSMutableArray.Create; for ProductID in ProductIDs do ProductIDsArray.addObject(PStrToNSStr(ProductID)); ProductIDsSet := TNSSet.Wrap(TNSSet.OCClass.setWithArray(ProductIDsArray)); FProductsRequest := TSKProductsRequest.Wrap(TSKProductsRequest.Alloc.initWithProductIdentifiers(ProductIDsSet)); ... FProductsRequest.setDelegate((FProductsRequestDelegate as ILocalObject).GetObjectID); FProductsRequest.start; end; constructor TiOSInAppPurchaseService.Create; begin ... FProductsRequestDelegate := TiOSProductsRequestDelegate.Create(Self); FProductList := TIAPProductList.Create; end; constructor TiOSProductsRequestDelegate.Create(const IAPService: TiOSInAppPurchaseService); begin inherited Create; FIAPService := IAPService; end; procedure TiOSProductsRequestDelegate.productsRequest(request: SKProductsRequest; didReceiveResponse: SKProductsResponse); begin FIAPService.FProductList.Clear; ... end;
  25. Hans♫

    AV with InApp purchase on MacOS

    I have attached the FMX.InAppPurchase.Mac.pas that we use so it is easy to use for others. All you need is to add it to your project and also add a modified version of FMX.InAppPurchase.pas where you include the file (just search for FMX.InAppPurchase.IOS, and see how that file is added, and do the same with the FMX edition) FMX.InAppPurchase.zip
×