Synchronize Or Queue UI Updates In Tasks With Delphi XE7 Firemonkey On Android And IOS

Delphi XE7 Firemonkey Synchronize And Queue TasksDeveloper 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.

Head over and check out the full blog post about synchronizing tasks on the main UI thread and then watch the video for in-depth parallel programming info.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Easily Sort String Lists And Objects With CustomSort In Delphi XE7 Firemonkey On Android And IOS

It is simple to sort a list of strings or objects in Object Pascal using TStringList from Delphi XE7 Firemonkey....