aspose file tools*
The moose likes Android and the fly likes Startup boot service stops itself - What to do? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Startup boot service stops itself - What to do?" Watch "Startup boot service stops itself - What to do?" New topic
Author

Startup boot service stops itself - What to do?

Andi Dan
Greenhorn

Joined: Feb 28, 2011
Posts: 18
Hi,

I want to start a service at bootup.
I've done a breoadcast receiver, started a service from broadcastreceiver, all inserted in xml.
The tutorial from http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/ helped me a lot.

The result:
On emulator, as on real device happens like this:
- service is started and then immediately stopps!
I don't know why the service stops!


The service is started for sure, I can read logs and toast msg. that certifies the service is started.

Also in logs I can see some msg like:

05-17 23:18:44.379: D/EAS SyncManager(247): !!! EAS SyncManager, onCreate
05-17 23:18:44.789: D/EAS SyncManager(247): !!! EAS SyncManager, onStartCommand
05-17 23:18:44.860: D/EAS SyncManager(247): !!! EAS SyncManager, stopping self
05-17 23:18:44.999: D/My Service(258): starting broadcast receiver
05-17 23:18:45.119: D/My Service(258): starting service in onCreate
05-17 23:18:45.985: D/Eas Debug(247): Logging:
05-17 23:18:45.999: D/EAS SyncManager(247): !!! EAS SyncManager, onDestroy
05-17 23:18:46.299: I//system/bin/fsck_msdos(29): Attempting to allocate 998 KB for FAT


The EAS SyncManager is destroyed. I belive this is the cause why my service is forced stopped.
From what I've read from http://hi-android.info/src/com/android/exchange/SyncManager.java.html it seams that when EAS SyncManager is destroyed, the started service on boot, receives a StopSelf() by default.

I don't know if this is true or not.
And if it is true... how can I fix it?
Does anyone confrunted with this until now?
Please help.
Andi Dan
Greenhorn

Joined: Feb 28, 2011
Posts: 18
you can find code posted on

http://stackoverflow.com/questions/10645106/service-bootup-android-forced-stopped-at-boot-what-to-do

Andi Dan
Greenhorn

Joined: Feb 28, 2011
Posts: 18
Solved it by making a widget without a view, and starting the service from the widget.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Startup boot service stops itself - What to do?
 
Similar Threads
WAS4.0 Connection Pool refresh
JSF Example Error
Caused by: FATAL ERROR: class com.capitalstream.common.ConfigurationError: Failed to Register a conf
Error : WSVR0068E: Attempt to start EnterpriseBean
"Application has unexpectedly stopped error" when adding onClickListener