[mono-android] AsyncTask issues and port of Andengine to monodroid (Andengine.net)

Jonathan Pryor jpryor at novell.com
Tue Mar 29 09:58:09 EDT 2011


On Mar 29, 2011, at 7:20 AM, James Burton wrote:
> I’ve noted that the AsyncTask class is apparently currently considered unusable

Good News, Everyone!

AsyncTask will be usable for the next release. It won't be perfect, but it will at least be usable. :-)

> If someone can provide a suggestion to the best approach to substitute for this within .NET then this would be really useful

.NET already has lots of primitives for "tasks" that Mono for Android exposes, from System.Threading.ThreadPool to System.Threading.Tasks and PLinq and...  For most developers writing new code, these should be the preferred primitives, as they'll promote portability with other ECMA runtimes. :-)

However, you mention that you're porting existing Java code. That's a somewhat different kettle of fish, as migrating threading code to a different system is unlikely to be trivial. The next release should help with this; otherwise, you're looking at deeply understanding the code and using .NET's existing primitives with copious use of Activity.RunOnUiThread().

 - Jon



More information about the Monodroid mailing list