Im wondering if there is a way in android to run tasks in the background by just using the android packages without using AsyncTask
. What i imagine is a background task which is still running when the Activity
is already finished or the app already got closed. I want the user to see the progress of this task in the notification tab of android (the tab you can swipe down from the top of the android screen).
I want to do this for example when i send e-mails or when i send data like images to the server. because they are quite long running tasks i dont want the user to wait for them to finish. i want them to run in the background so that the user can close the app. and i want the user to see the progress in the notification bar.
Also i would like to know if there is a way to automatically repeat such a background task when it failed because the device did not have connection to the internet.
Im looking forward to read the answers and to learn something new.