File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes Problem with BroadcastReceiver and IntentService Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Problem with BroadcastReceiver and IntentService" Watch "Problem with BroadcastReceiver and IntentService" New topic

Problem with BroadcastReceiver and IntentService

Ozzy Boshi

Joined: Sep 21, 2012
Posts: 7
Hello JavaRanch Forum,
I am a begingger in Android Java Programming and I stumbled upon a problem.

I want, every time my phone boots up, a service that is activated every x minutes.
In order to do this I tried to use a BroadcastReceiver that creates a new AlarmManager object in this way.

I set up my android manifest file and all seems ok to me.
When the phone boots up i see the "Receiver OK" message on my Logcat window.
At this stage i'd expect that this broadcast receiver, every minute, is set to launch a new instance if UpdaterService.class but it doesn't happen.
Right now the UpdaterService class is a subclass of IntentService and it's made of only of a constructor and a onHandleIntent() method (overridden).
Inside the onHandleIntent there is only a Log.d() , so at the end i would expect to see this Log.d passing through my Logcat window but this does not happen, can someone tell me why?
If i try to launch UpdaterService from an Activity using startservice(), updaterservice fires up and the Logcat window show the messages (but only once of course)

I agree. Here's the link:
subject: Problem with BroadcastReceiver and IntentService
jQuery in Action, 3rd edition