Clayton A. Alves 0 Posted December 26, 2024 (edited) I've made a virtual number keyboard using fmx. Each key is a TButton, inside a TGridLayout. Each TButton updates a TEdit with the corresponding number (from Text property). When I run the application on Android 14, it works ok. When I run this application on Android (8.1.0 Oreo), on a real device, the time from the touch to the response (updating the TEdit) is really slow. If I place the buttons outside the TGridLayout, the performance get's a little better. If I replace the TButtons to TRectangles with TText, the performance get's even better. Is there any property or configuration that I can set to make the TButton version respond faster ? Maybe the issue is related to the animation when the button is clicked, but I can't find a way to turn it off. Below is an image of the app running. This is the device i'm testing: https://www.jarltech.com/sites/default/files/images/product/main/SUN_d2_mini_front_web.png Edited December 27, 2024 by Clayton A. Alves Share this post Link to post
Dave Nottage 568 Posted December 27, 2024 5 hours ago, Clayton A. Alves said: Is there any property or configuration that I can set to make the TButton version respond faster ? 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. Share this post Link to post
Clayton A. Alves 0 Posted December 27, 2024 8 hours ago, Dave Nottage said: It might help to indicate which version of Delphi. I'm using Delphi 10.4.2 (Sydney). I've attached the sample test project I'm using. tbutton_touch_test.zip Share this post Link to post
Dave Nottage 568 Posted Friday at 01:30 AM On 12/27/2024 at 10:24 PM, Clayton A. Alves said: I've attached the sample test project I'm using. 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? 1 Share this post Link to post
Minox 8 Posted Saturday at 12:59 PM (edited) I tried it on a Samsung A13 and all the keys respond the same way, without any apparent delay (D12) Edited Saturday at 01:00 PM by Minox 1 Share this post Link to post
alejandro.sawers 14 Posted Saturday at 03:51 PM Compiled the app on Delphi 10.4.2, tested on a Samsung J2 Core device (Android 8.1) and didn't notice any considerable lag/delay. Screen record below: rec3.mp4 On 12/26/2024 at 6:16 PM, Clayton A. Alves said: Maybe the issue is related to the animation when the button is clicked Could be. Maybe some OS customization is causing FMX to perform poorly. Try to run an app with simple animations or content scroll. 1 Share this post Link to post
Clayton A. Alves 0 Posted 16 hours ago (edited) I've tryed OnTap event handler instead of OnClick but it keeps the same. On the last test I've used the native keyboard for comparison. output.mp4 Edited 16 hours ago by Clayton A. Alves Share this post Link to post
alejandro.sawers 14 Posted 13 hours ago Yeah, looks like a performance issue. Some things you could try (but before that please run more tests with other input controls, animations, tabs, timers, etc. so you know if the issue is visual or general performance): - Change your Form's Quality to HighPerformance - Switch to native controls - Test with Skia4Delphi - Try with third-party controls like Alcinoe or FGX (never tested these personally) However if the performance culprit is not merely visual (i.e. impacts the RTL) then the best option could be, if possible, to work with the device manufacturer / docs and check if something can be done at their OS level. Good luck. 2 Share this post Link to post