title: Can I register my app as an alarm clock handler?
body: <p>I'm working on a streaming radio app, which can play one of a predefined set of stations. I would like to integrate this with existing alarm clock apps, without having to build any alarm functionality into the app itself.</p>
  
  <p>When the alarm goes off, the radio should start playing. Ideally it should play a station chosen by the user beforehand, but I'll settle for storing the last used station and playing that instead.</p>
  
  <p>I looked through the <a href="https://developer.android.com/guide/components/intents-common.html" rel="nofollow">common intents</a> available on Android, but there doesn't seem to be anything appropriate. In particular:</p>
  
  <ul>
  <li><code>INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH</code> requires a free-form search query, which doesn't seem appropriate.</li>
  <li><code>ACTION_VIEW</code> requires a URL. I could use the stream URL of the radio station, or maybe come up with a custom URL scheme like <code>my-radio-app://station-id</code>, but then how do I convince generic alarm clock apps to show the user a list of available stations?</li>
  </ul>
  
  <p>To approach it from the other end, I looked at existing alarm clock apps. The stock app doesn't do any integrations. The Sleep as Android app that I use can trigger Spotify, but I think that's a custom built integration. It also seems to read and list all music tracks from the SD card.</p>
  
  <p>Am I trying to do the impossible? Are these intents just not standardised?</p>