Developer Malcolm Groves from Embarcadero has a blog post up with some code showing how to update your app UI from Tasks in Delphi XE7 Firemonkey. Basically Tasks use threads to get things done and you can no update the UI from a thread without causing problems. The solution for this is to use either TThread.Synchronize or TThread.Queue. What these two functions do is run the function that you pass to them in the main thread. The Synchronize function runs it in the main thread now blocking it and the Queue function with run the function at some time in the future and will not block the main thread. The blog post also has an embedded video which is a thirty minute plus tutorial on using Tasks, Futures, and parallel programming in your apps. The goal with using all of these threads, async anonymous functions, tasks, and futures is to keep your app responsive so that the user isn’t waiting needlessly. This information applies to apps for Android, IOS, OSX, and Windows. It should also compile under Appmethod.
Synchronize Or Queue UI Updates In Tasks With Delphi XE7 Firemonkey On Android And IOS by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.