I have been thinking: What happens when your phone has 100+ (ok the number is a bit big) BroadcastReceivers listening to the BOOT_COMPLETED intent. That would make booting your phone slow like hell. Even without the starting of Services.
So my sollution would be to make a BroadcastReceiver, to which other developers can register their Service, which they want to start at boot. This will make the system start 1 BroadcastReceiver instead of the 100+ and dramatically lowering boot time.
Services should be registered using a ContentProvider if a Service is in it (it's intent that is), the OpenBootReceiver will launch it. Simple as that.
Another major advantage is: it is very simple to not have your Service started, just remove it from the ContentProvider and you are done, whereas with the normal approach, your BroadcastReceiver will always be started, as you can't unregister it!
Ofcourse, this simple approach will only make it possible to start the Service and not check for any condition, so this should be done in the Service itself OR you should still make your own BroadcastReceiver. But I think most such checks could be done inside the Service itself.
What is your opinion about this? Do you think this is usefull or not? Would you use it? Any further sugestions?
Thanks in advance!
Added the other "major advantage".