Its called services. You can run process in background once you get permission from user.
please learn more about services from here:
https://developer.android.com/guide/components/services.html
1
solved How android reminder app works after closing it