Saturday, October 6, 2012

A Podcast Alarm Clock on Android (BeyondPod Smart Play)

[Instructions at end of post]

I have been wishing for a long time to wake up to podcasts instead of music in the morning. Hearing the news for an alarm instead of the same song everyday gives me something to think about, which usually gets me out of bed much quicker.

My first try was creating my own app to do this. But I quickly realized that I could neither create an alarm app that works as well or has as many features as others, or a podcast catcher that  works as well as something like my beloved BeyondPod. Plus, creating my own app would violate the unix philosophy of not creating duplicate solutions to a problem.

Instead, I decided the best approach would be to link apps designed to do each of these. I had discovered BeyondPod, and loved many features of it - especially smart play, which allows me to hit one button, hop on my bike, and enjoy good podcasts for the entire ride. Many alarm clock apps like alarm clock plus allow you to launch an app instead of playing music, but if you launch BeyondPod, it does not start playing automatically.

I checked out the AndroidManifest.xml for BeyondPod and noticed that there actually is a way to send an Intent to BeyondPod to instruct it to start playing - there is even one to start the smart play playlist! These intents are shown here: http://beyondpod.com/support/index.php?/Knowledgebase/Article/View/31/5/beyondpod-public-apis .

Needless to say, I was pretty excited about finding this. So I downloaded AppAlarm thinking that I could just plug one of these intents in, and immediately get it working. Sadly this is not the case. If you create a new alarm with a Custom Intent with the Action: "mobi.beyondpod.command.START_SMART_PLAY", it doesn't work. I am still not quite sure why this is the case, but I suspect that it is because AppAlarm uses startActivity() rather than broadcastIntent() when it sends the intent.

So, I still didn't have the solution. Finally, I stumbled upon this page: http://ig88.cwfk.net/?page_id=73, which specifically mentions sending one of the BeyondPod play intents. This app allowed me to finally string it all together - see the instructions below.

After all this, I really want to thank some people:
1. The architects of the android operating system, for making it easy to link apps together with concepts like Intents.
2. The programmers of BeyondPod, AppAlarm, and Manual Intent Shortcuts for making apps that solve their corresponding problems well.

These people didn't do a perfect job (i.e. imho BeyondPod should make itself launchable from AlarmClockPlus, AppAlarm should have support for broadcasting intents and a gentle volume increase, and Manual Intent Shortcuts should have a test button), but they did a good enough job designing their apps to solve individual problems that I was able to accomplish something with these tools that they probably didn't specifically intend. And that is programming goodness.


How to get it working:

1. Install AppAlarm ProManual Intent Shortcuts, and BeyondPod (I'm not sure if this will work with the free version of BeyondPod, but BeyondPod is one of my favorite apps, so I would recommend buying the unlock key)

2. Set up smart play in BeyondPod according to whatever you want to hear in the morning (I recommend some nice, soothing NPR news: NPR 7 am News Summary (podcast url: http://www.npr.org/rss/podcast.php?id=500001).

3. In AppAlarm, create a new alarm.
Click "App To Launch"
Select "Create Shortcut"
Scroll down and select "Manual Intent Shortcuts"

Fill in the  following fields (you should omit the quotes):
Shortcut Name:"BeyondPod Smart Play" (or whatever you want - doesn't matter)
Action:"mobi.beyondpod.command.START_SMART_PLAY"
Broadcast:<checked>

4. Set up the alarm however you want it. In the alarm Volume Options, make sure you check Set Media Volume, so that you don't miss the alarm.


If you want to wake up to something besides Smart Play:

In BeyondPod 3.0.20 and later, there is a feature called "Quick Play" which works with Android's voice search so that you can say "Listen to News" for example and hear all podcasts in your News category. We can also use quick play for an alarm, and with this configuration, we don't need Manual Intent Shortcuts. To do this, modify instruction 3 as follows:

3. In AppAlarm, create a new alarm.
Click "App To Launch"
Select "Create Shortcut"
Scroll down and select "BeyondPod Quick Play"

This will allow you to choose which category you would like to listen to when the alarm goes off. (Thanks to Daniel for pointing this out)



7 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Thanks for posting this! I didn't find Manual Intent Shortcut with my own search, and it was just what I was looking for to create a PLAY shortcut for the lock screen slider.

    ReplyDelete
  3. You, sir or madam, are my hero.

    ReplyDelete
    Replies
    1. Haha, Thanks - don't get too excited though, there are still problems with this... snoozing doesn't work too well for one thing.

      Delete
  4. It seems QuickPlay is now an option in the "Create Shortcut" menu you refer to directly without the need to install Manual Intents. Unix philosophy++.

    ReplyDelete
  5. You, Sir, are a gentleman and a saint!

    Well, at least a saint who protects me from oversleeping! :)

    ReplyDelete