I'm trying to start an Android Service on Boot that entails starting advertisements on boot which can be read by a BLE scanner. Do you know how to go about doing so? Currently, I keep getting "Unfortunately, 'myService' has stopped." Note: I am using Xamarin for Android development.
Asked
Active
Viewed 238 times
2

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Ajmal Khan
- 33
- 4
-
1What does your logcat say? – Bryan Herbst Jun 26 '15 at 13:57
-
Post the crash log and stacktrace from the logcat – David Wasser Jun 26 '15 at 14:12
1 Answers
1
In order to do this you need to register a BroadcastReceiver for the system intent "android.intent.action.BOOT_COMPLETED" on your Android manifest. However, if your application is installed on the external storage use "android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE". From this BroacastReceiver you can then start your Service.
There's a nice tutorial here that should meet your needs. Also check this other SO question which has a detailed explanation on the subject.

Community
- 1
- 1

Moises Jimenez
- 1,962
- 3
- 21
- 43