• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Startup boot service stops itself - What to do?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can find code posted on

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

 
Andi Dan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solved it by making a widget without a view, and starting the service from the widget.
reply
    Bookmark Topic Watch Topic
  • New Topic