I'm developing an app that will monitor a user's activity throughout the day, and when a particular activity is detected (i.e., driving) a notification will be triggered. The Google Play Services now supports ActivityRecognition, which really makes the task easier and more efficient (instead of messing with GPS/other sensors).
My question is - can I get the activity recognition to run entirely as a service? From my reading, it appears that the recognition must be initiated by an Activity (making the connection to the Play Services, triggering an intent, etc). That's fine when a user is interacting with the app, but if the phone reboots or the activity is otherwise closed, I need the service to keep on running in the background so it can continue to monitor users' activity and send pop-up notifications. Is there any way to do this? If so, are there any examples of this online? Thanks in advance!