I would like to implement long running calls from the scripter and found the Paused property perfect for that.
In a custom scripter method I set Paused := True, do some background work and afterwards I set Paused := False.
Under windows it works perfectly, under android the UI becomes unresponsive until the scripter is unpaused.
I attached a demo project showcasing this behaviour. pause-scripter.zip (11.8 KB)
Observed behaviour:
After pressing the "Execute" button, I cannot click into the memo
After 10 seconds a message box pops up
After closing it it, I can click into the memo and the keyboard shows up
Expected behavior
After pressing the Execute button, I can click into the memo and the keyboard shows up
When Scripter is paused, it enters in a loop until the Scripter is unpaused. During that loop, it calls Application.HandleMessage so that the application continues to be responsive. That is just Delphi code, and it simply works on Windows, but not on Android.
That is unfortunate, since iOS behaves like Windows and Android seems like an outlier.
I briefly explored the idea of running the scripter in another thread, but because a lot of the script accesses UI components synchronization made it feel really sluggish.
I decided to just use a callback parameter for my long running call instead of trying to pause execution.