I'm triying to start a android service in android 4.0 when the device is booting, in boot time, but it's imposible , I had be used many codes, copy and paste. I had used code from here, stackoverflow of others examples and questions , but for me is imposible. I'm using android 4.0.1 in a table Acer Iconia A501. I put my code here. Somebody Can it try this code??? this is the page :This page please, it is easy
Asked
Active
Viewed 1,659 times
0
-
If you're so sure it's impossible, then what question is there to answer? Can you post what you have tried? – Brad Jul 24 '12 at 22:19
-
can you please edit your question and add your code – FoamyGuy Jul 24 '12 at 22:27
-
I have this same code in my app and at startup on a Razr XT910 phone with 4.04 android it boots up and starts both my apps just fine. Please add your Manifest xml code and your BootupReciever code – JPM Jul 24 '12 at 22:30
-
I cant reach personal blogs from where I am at. – Code Droid Jul 24 '12 at 22:40
-
please be sure to check the manifest very carefully. AND when running the code, goto Window --> ShowView -->Logcat and tell us if you see any errors there. But first make sure you are getting the BOOT_COMPLETE. You can just issue notification or log to check this. – Code Droid Jul 24 '12 at 22:46
-
Do one thing at a time. Don't try to start a service until you are certain you are receiving the BOOT_COMPLETE. Then make sure you are seeing the log file before you try to connect to service so you can check for errors. – Code Droid Jul 24 '12 at 22:47
1 Answers
1
You need to register a broadcast receiver for the intent that is broadcast on startup. There is ZERO doubt that this is what you need to do.
See: BroadcastReceiver not receiving BOOT_COMPLETED
You need to do the same. Register a broadcast receiver and first make sure that you are catching the BOOT_COMPLETED event. Then its just a matter of doing a startService.
The problem is most likely in the Manifest. Check that you have exactly the right name for everything. Note the . in names like .MyBroadcastReceiver These are important. Missing just one thing will cause a problem.
Both the Receiver and Service definition must be perfect. Also check logcat and tell us what errors are there.

Community
- 1
- 1

Code Droid
- 10,344
- 17
- 72
- 112