You can use work manager to run your app when it is closed. Its easy to implement and work as you mentioned I think