Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Yaron last won the day on November 13 2018

Yaron had the most liked content!

Community Reputation

13 Good

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. When specifying the multiple resolution images in the project's options page, there doesn't seem to be any relations between the device's screen resolution and the resolution of the splash image. For example, on a Note4 device with a screen resolution of 1440x2560, the "470x320" (blurry) splash screen is displayed. Is there a way to influence this selection?
  2. I was doing this in v10.2.3 and it was not stable, I chronicled my experiences here: https://stackoverflow.com/questions/52168940/is-png-decoding-not-thread-safe-under-android After replacing TBitmap PNG decoding with JBitmap, the issue was resolved, so I do believe that at least in v10.2.3 TBitmap is not thread safe.
  3. Yaron

    Issue with code-editor toolbars

    I just realized that the "palette" window switches context between new project files or components based on whether you're editing code or the form. 🤯
  4. Yaron

    Issue with code-editor toolbars

    For me "View - Tool Windows - Palette" shows a new project selection palette window (similar to File -> New) and not the components palette.
  5. Yaron

    Issue with code-editor toolbars

    I would actually like to switch to the new component pallet, but for the life of me, I can't find the setting that switches between the old and new layouts.
  6. The last time I suffered from TBitmap threading instability was in v10.2, so perhaps that's been resolved.
  7. Something weird happened in the post above, I can't edit it for some reason. I tried doing the pre-calculations in a thread, but it resulted in instability. what I'm doing is resizing graphic elements and I simply can't get TBitmap to work without throwing exceptions in a thread on Android.
  8. The problem causing my app not to show was that I had to create a separate "<intent-filter>" block, after doing that it seems to function correctly.
  9. I managed to get the app listed in YouTube by modifying the manifest's intent using: <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> However my app still doesn't show up on the device's app page.
  10. I am trying to write a very basic Android app that will receive a share from the YouTube app and show the data in a memo. I tried basing it on Embarcadero's Receive Intent sample: https://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RADStudio_Seattle/Object Pascal/Mobile Snippets/AndroidIntents/ReceiveIntent/ The only thing I did to the sample was to change a line in AndroidManifest.template.xml from: To: However, I'm encountering two issues: 1. After installing the app on an Android device, it isn't listed in the app list. I can see it on the "application manager" settings page, but not in the main app list. 2. YouTube is not listing the app as an option on the share dialog. How can I resolve these 2 issues?
  11. Just to make sure I understand, this implies I can't do UI updates in my main thread in the middle of a function?
  12. I actually posted this question on stack overflow a while back, got what I thought was a working answer but over time realized that on different devices, waiting for "onIdle" doesn't actually work. Here's the background, my app on first-load does some time-consuming (3-8 sec) pre-calculations so subsequent runs would be much faster. During this processing period, I want to show a "loading %" track-bar. However, for the life of me, I haven't been able to find the exact moment my form is visible and responsive for action. I tried different approaches: 1. waiting for "OnActivate" event. 2. Implementing IFMXApplicationEventService.SetApplicationEventHandler and waiting for "TApplicationEvent.BecameActive". 3. Waiting for "TApplicationEvent.BecameActive" to trigger and then waiting for 3 "OnIdle" events to trigger (2 OnIdle events were not enough for my Galaxy Note 4 device). Only #3 sort of worked on most devices using Delphi 10.2.3, but then when I upgraded to Delphi 10.3.1 even that stopped working (my progress bar shows up but the screen stops updating, so the bar remains on 0% until the pre-calculation function completes, even when calling Application.ProcessMessages after each update and no other code running in the background). Is there a better solution to know the exact moment my app will start responding to screen updates on launch under Android?
  13. @Dave Nottage I can't really debug since I constantly suffer from the "Unable to start gdbserver on port '64311'. Port is already in use.", so instead I've added many more debug output lines. I finally figured out what was going on, I was creating my bitmap inside a function that was triggered by a timage-clicked, that function then called the permission request with an anonymous function. However, once the anonymous function was triggered, the bitmap var was no longer valid. I fixed the issue by creating the bitmap within the anonymous function.
  14. I am trying to save an image to the photo gallery using Delphi 10.3 and Android 6+ However, when the user accepts the access request prompt on the very first call, my entire app restarts all on it's own, is there any way to disable this behavior so my app doesn't restart? I implemented the code based on this blog post: http://blong.com/Articles/AndroidPermissions/DelphiAppPermissions.htm After calling (on form create): FPermission_READ_EXTERNAL_STORAGE := JStringToString(TJManifest_permission.JavaClass.READ_EXTERNAL_STORAGE); FPermission_WRITE_EXTERNAL_STORAGE := JStringToString(TJManifest_permission.JavaClass.WRITE_EXTERNAL_STORAGE); I am calling this code to show the prompt and save the image: // Request permission PermissionsService.RequestPermissions([FPermission_WRITE_EXTERNAL_STORAGE, FPermission_READ_EXTERNAL_STORAGE], procedure(const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>) begin if (Length(AGrantResults) = 2) and (AGrantResults[0] = TPermissionStatus.Granted) and (AGrantResults[1] = TPermissionStatus.Granted) then Begin { Save file } BaseFolder := System.IOUtils.TPath.GetSharedPicturesPath; If DirectoryExists(BaseFolder) = True then Begin PIKAFolder := BaseFolder+System.IOUtils.TPath.DirectorySeparatorChar+clientGameName; If DirectoryExists(PIKAFolder) = False then ForceDirectories(PIKAFolder); PIKAFile := PIKAFolder+System.IOUtils.TPath.DirectorySeparatorChar+clientGameName+'_'+ReplaceStr(ReplaceStr(DateTimeToStr(Now),':','.'),'/','.')+saveImageFileExt; Try MyImage.SaveToFile(PIKAFile); Except clientFadingMessage := strErrorSavingPicture; End; If FileExists(PIKAFile) = True then clientFadingMessage := strPictureSaved else If clientFadingMessage = '' then clientFadingMessage := strErrorSavingPicture2; End Else clientFadingMessage := strPictureFolderNotFound; End else begin clientFadingMessage := strErrorSavingPicture; end; end );