Quick links:

What?

Intent Radio (or IR) is an android audio media app without a graphical user interface. It is controlled exclusively through the delivery of broadcast intents, typically generated by an automation app such as Tasker. If you don’t know what a broadcast intent is, then this is probably not the app for you.

Despite the name, IR will happily play local audio media too. Once you’re done reading here, take a look at this approach to having IR manage a playlist of songs.

Why?

It’s simple:

  • Automation.

Tasker is an automation app for Android. It’s a small graphical programming language combined with a mechanism to fire off tasks in response to various events.

IR was written primarily to be driven by Tasker, either via task shortcuts, or in response to events such as a headset plugged in or out. Or perhaps based on the type of network to which you’re attached. Or the network’s SSID . Or the time of day. Or the day of the week. Or some combination of the above. Or whatever…

How?

Intent Radio supports the following broadcast intents…

org.smblott.intentradio.PLAY
  • start playback

  • extras:

    • url — the URL to play

    • name — the display name for the station

Both extras are strings, and both are optional.

If url is omitted, then Intent Radio restarts the previous station. If there is no such station, then it plays BBC Radio 4 (because, well, why not?).

org.smblott.intentradio.STOP
  • stop playback

  • extras: none

org.smblott.intentradio.PAUSE
  • pause playback, if playing

  • extras: none

org.smblott.intentradio.RESTART
  • restart playback, if paused

  • extras: none

org.smblott.intentradio.STATE_REQUEST
  • request that IR broadcast its state (see below)

  • extras: none

This intent is not required to receive state updates. IR always broadcasts its state whenever it changes.

org.smblott.intentradio.STATE
  • this is broadcast by Intent Radio itself to inform listeners (such as Tasker) of its state

  • extras:

    • state: one of stop, play, play/buffering, play/pause, play/duck, complete, or error

    • url: the current URL

    • name: the current station name

These are all strings.

The sample Tasker project includes a listener which sets the global Tasker variables %IRSTATE, %IRURL and %IRNAME whenever such an intent is received.

If you are not using the sample project (or have installed an earlier version and edited it to meet your own needs), then set up Tasker as follows:

  • Create a new Tasker profile: event/System/Intent Received.

  • Set Action to org.smblott.intentradio.STATE.

  • Within the associated task, the local variable %state is the current state, %url the current URL, and %name the current name. Assign these to global variables of your choice, such as %IRSTATE, %IRURL and %IRNAME.

More Information:
  • During playback, IR places a notification in the notification area. Clicking on the notification causes playback to either stop or (re-)start, as appropriate.

  • IR uses the built-in Android media player for playback. So all audio codecs supported natively by Android are supported.

  • Additionally, Intent Radio supports PLS playlists (suffix .pls) and M3U playlists (suffix .m3u or .m3u8). For example:

    • http://www.bbc.co.uk/.../xxx.pls

    • http://www.bbc.co.uk/.../xxx.m3u

    • http://www.bbc.co.uk/.../xxx.m3u8

Important!
  • Although IR has no graphical user interface, you must nevertheless launch the app at least once. Otherwise, Android will not deliver broadcast intents to the app’s background service. This is an Android security feature.
    Thereafter, it should not be necessary to launch the app at all, even after a reboot or an upgrade.

  • IR is built for Android API level 16, so only for 4.1 (Jelly Bean) devices and above.

More…

If you’re using Tasker:
  • Then this Tasker project may be helpful in getting started with Intent Radio.
    This project can also be installed from within the app itself.

  • Or, there are some basic instructions here.

Downloads

Downloads:
  • Available on the Google Play Store.

  • Also available on F-Droid.
    If you use this version, then also install the F-Droid app in order to receive notifications of new releases.

Do not install versions from both of these sources. Pick one and stick with it. They’re the same thing.

Alternatively:

  • Pick up the latest release from Dropbox.

Release Notes

Version 1.9.11:
  • Add permission to read external storage. This should allow IR to play content stored in external storage.

Version 1.9.10:
  • Just change the default URL (because the BBC have been diddling with their URLs).

Version 1.9.9:
  • Considerably better (but not yet perfect) handling of drops due to intermittent network connectivity.

  • Now defaults to reconnect on network drops.

  • Fixed minor bugs and/or inconsistencies.

  • Check out the web page for information on how to handle playlists.

Version 1.9.8:
  • Add option (disabled by default) to restart playback if the network connection is lost and then re-established.

Version 1.9.7:
  • Better playlist detection and handling.

  • Bug fixes for playlist handling.

  • Bug fixes for audio focus.

  • Better default BBC Radio 4 URL.

  • Clarify in-app messages.

  • Disable recursive playlist fetch.
    Without recursive playlist fetch, we can use better URLs for some stations, including some important BBC radio stations.

  • Use better (faster start up) URL for default radio station.

  • Add in-app preference for cancelling the notification.

Version 1.8:
  • Major reworking of notifications, including look and click behaviour.
    When stopped or paused, clicking on the notification now restarts.

  • Substantial reworking of the state/audio-focus/thread model.

  • Recursive playlist fetch.
    If a playlist contains a playlist, then fetch that too.
    Post a playlist of your favourite stations online somewhere, even containing playlists itself, point Intent Radio towards it, and listen to a random favourite station.

  • Changed name of state play/dim to play/duck; added state complete.

  • Add .M3u8 playlist type (for BBC Media Selector).

Version 1.7:
  • Add button to install sample Tasker project.

  • Improved (extended) the sample Tasker project.

  • Broadcast state (can be tracked in Tasker).

  • Sample project sets Tasker global variables %IRSTATE, IRURL and IRNAME to broadcast state.

  • Handle implicit intents.

  • A PLAY request without a "url" plays last station, if possible.

  • Re-use MediaPlayer instance.

  • Better notifications.

Version 1.6:
  • Separate page for clipping intents to clipboard.

  • Better layout in app.

  • Notification persists after errors
    (but then it is not ongoing, so it can be dismissed).

  • Version and build date visible in app.

  • Much code refactoring and clean up.

Version 1.5:
  • Pause/restart broadcast intents.

  • Improved handling of audio focus.

  • Improved notifications.

Version 1.3:
  • M3u playlist support.

Version 1.2:
  • Obtain WiFi lock when on WiFi.

  • Handle audio focus events.

Version 1.1
  • Use httpURLConnection.

  • Fetch playlists on an asynchronous thread (so, non-blocking).

Version 1.0
  • Initial release.