Forum Xamarin.Android

background process(configuration) and show progress indicator until it finishes?

mk18576mk18576 Member ✭✭

How to initiate background process(configuration) and show progress indicator until it finishes?

Best Answers

  • mk18576mk18576 Member ✭✭
    Accepted Answer

    Awesome..thanks

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Based on your description, I think that achieve a forground service is a good choice, then push a notification, show the progress in the notification.
    https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/services/foreground-services

    Due to you initiate background process, this process is a time-consuming operation, It will make ANR easily(if not run it in service), and foreground service will make sure this initate process could be operated successfully, normally it will be killed by GCM.

  • mk18576mk18576 Member ✭✭

    Thanks LeonLu...While this seems to be appropriate for my question, I had another query. When the app starts for the first time and I want to connect several devices using API calls; so in order to achieve this I was thinking to show the round progress bar so that the user does not interact with the UI controls. However if the time is unkown, I don't want to hard code the timer...In that instance what would be the appropriate solution?

    Thanks again

  • mk18576mk18576 Member ✭✭
    Accepted Answer

    Awesome..thanks

Sign In or Register to comment.