I have a background service that should always run. It should wait for in-coming e-mails, when an e-mail arrives(to my old phone), it will trigger an action. (to send an sms to my new phone). Not a clever user-case but just learning android.
However, All the above works fine if I keep the app in 'Recent' apps. The moment I swipe it off, it doesn't work.
Any idea on how can I achieve this?
I have seen in some apps like Whatsapp, Facebook etc.. that even after we swipe off, there is a background service running to listen new notification etc. How do I achieve with my app??