Automatically trigger a closed application

I want to develop an application that warns the user 5 times a day.Like an alarm.No problem when app is open.I want to warn you when the app is closed.How can I trigger the application when the application is closed.The application should open automatically like an alarm application