0

I am trying programming in android using Xamarin.android using C#. While watching a tutorial of android I have found out that they are using Thread for asynchronous programming but in C# Async/Await is what i like to do.

So my question is - Can these Threads be replaced directly by Async/Await Tasks in C#.

1 Answer 1

3

It depends on what sort of asynchronous programming you're talking about. If it's background processing, then you'll still want a task on a different thread. You can still use async/await for that, of course.

If it's really just asynchronous IO - make a web request, wait for the result, etc - then yes, async/await should make this much simpler, and you should be able to avoid having any extra threads.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.