No, there is no clean way to get application shutdown time. But I could offer you a dirty trick to use the service to update your application (stand-alone functions) for every n minutes.
When the OS kills your application, it removes all associated services and the broadcast receiver along with it.
source
share