In reading some android documentation, it seems like intent-filter indicates what intents the application is interested in. In my application, I am interested in receiving BluetoothAdapter.ACTION_STATE_CHANGED. I didn’t declare it in my manfiest xml file, but in my application I register a BroadcastReceiver that filters on BluetoothAdapter.ACTION_STATE_CHANGED and I receive the events just fine.
Can someone explain then why I would use intent-filter?
So your application can receive the event even if it’s not already running.
See http://developer.android.com/guide/topics/manifest/receiver-element.html:
Declares a broadcast receiver (a BroadcastReceiver subclass) as one of the application’s components. Broadcast receivers enable applications to receive intents that are broadcast by the system or by other applications, even when other components of the application are not running.
There are two ways to make a broadcast receiver known to the system: One is declare it in the manifest file with this element. The other is to create the receiver dynamically in code and register it with the Context.registerReceiver() method. See the BroadcastReceiver class description for more on dynamically created receivers.