Android: how to start a service at boot based on user-settings?
<p>Hey everyone,
I'm trying to write an app that consists of an activity that manages a background service. However, I want to implement a user setting for automatically starting the service up at boot time. I have user settings implemented with SharedPreferences and I have the services starting up at boot by using a BroadcastReceiver and listening for BOOT_COMPLETED.</p>

<p>However, I can't figure out a good way to implement a setting so that the service is only started at boot if said setting is enabled. I can think of a few cheap ways to do this (such as messing with onCreate() in the service, or creating/checking for a file on SD card) but I want to follow good practice.</p>

<p>There must be a good way to do this because there's tons of apps out there that do it, I just can't find anything online about how to do it.</p>

<p>Thanks</p>
