I mean, but if the device notifies you that it's running low on battery... maybe you should close the app? Shouldn't this be enough?
You would avoid loosing data, and regarding user experience, also avoid a slower performance of your app (and perhaps complaining about it?), and also seeing your device shutting down itself with your app screen running in background (which is pretty lame).