My application is a boot-start Android service. Up until now, I have been starting the service from MainActivity (which calls Forms.Init), this works fine. When the service is started by the system via a receiver on the android.intent.action.BOOT_COMPLETED intent, it obviously cannot call Forms.Init as there is no activity present until such a point as the user taps the notification and launches MainActivity.
I have had a search of the forums and there appears to be no way around this other than a massive re-factoring effort to move platform independent business logic code into Xamarin.Android (and then to duplicate it for Xamarin.iOS). Before I undertake this massive re-factoring and code-duplication effort, is anyone able to confirm that this is, indeed the case?
My application's service connects to a device over BLE and maintains this connection. It notifies the user when events arrive at the service. All my code dealing with queue's, queue draining, the intermittent nature of a BLE connection etc was in a .net2.0std PCL, but since I cannot use the DependencyService from a service, it looks like I simple CANNOT CALL ANY SHARED CODE from a boot start service, as going so REQUIRES the DependencyService and the DependencyService can only be started from an activity??