Android design : background long running service or AlarmManager?
问题 I am building an app which will monitor the battery state, wifi connection and location data at regular intervals and will write the results in a file (and later send them off to a server). On installing the app monitoring should be disabled - but the user enabling it should survive a reboot. After a lot of reading I have realized that I have basically 2 options : Subclass Service and fire it off from my activity. Set it on foreground, STICKY and what not and hope that it is not killed by