2

I have implemented job scheduling using Firebase job dispatcher. In which it was given in the doc that an IntentFilter with a specific action Action should be added to the job service as below

<intent-filter>
    <action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" />
</intent-filter>

What is the use of the adding the above IntentFilter while the jobscheduling is working fine even without that

arjun
  • 3,514
  • 4
  • 27
  • 48

1 Answers1

2

An intent filter specifies the types of intents that an activity, service, or broadcast receiver can respond to. It allows service to start when it receives intent of specific type while ignoring others which are not meaningful for the service. So, if you are NOT specifying intent filter jobscheduling will work but there is no restriction on the service for the type of intent it should respond to.

Intents sends signals to the Android system telling it that some action needs to be performed by another component in the same app or a different app.

So, when you have scheduled job and added intent filter ,your service will respond to event with action com.firebase.jobdispatcher.ACTION_EXECUTE only.

Moha the almighty camel
  • 4,327
  • 4
  • 30
  • 53
Android Developer
  • 9,157
  • 18
  • 82
  • 139