Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

What is the best approach to perform a background task?

MikeDennisMikeDennis USMember ✭✭

Current Scenario: user will keep adding item from the Xamarin.Forms - > On every add there should be a background process carried out which will take around 30secs, during this period user should be allowed to perform the operation. basically a queue structure without blocking the user in android


  • MikeDennisMikeDennis USMember ✭✭

    @AdamP any idea on this question?

  • MikeDennisMikeDennis USMember ✭✭

    Tried using the intent service but it blocks the main UI...

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @MikeDennis - if its only taking around 30 seconds and it doesn't interact with the UI at all, then I would recommend you use Task.Run(async ()=> {});

    This will run the task on a different thread than the UI.

  • Maharshi.5212Maharshi.5212 USMember ✭✭

    I tried to run a forms application on windows RT and there are some background tasks.
    I used Task.Run(async ()=> {}) for android. It was throwing an exception in windows rt when I try to use Task.Delay . Like Property nameRoot is not null.

    How to use Task.Delay in windows rt environment.

Sign In or Register to comment.