On Android, if you type a URL to an MP3 file in the browser (or click on a link to the file) you get that “Complete action using” popup with some applications listed that can play the file (Music, StreamFurious, Streaming Media Player, Winamp, XiiaLive Lite, to name a few). How can I get my application to show up in that list?
I’m pretty sure there’s an intent-filter I have to add to the AndroidManifest.xml but I have no idea what action, category, or data needs to be in it. Anyone know what I have to do? Also, is there some way I can trace intents that called on the system? That might make it easier to figure out how to do other things like this in the future.
Based on what I saw at code.google.com/p/andless/source/browse/trunk/AndroidManifest.xml?spec=svn86&r=86# I tried this:
<activity android:name=".Main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="audio/mp3" android:scheme="file" />
</intent-filter>
</activity>
but that didn’t do it. Then I downloaded andLess from the market and realized that app doesn’t show in the “Complete action using” list either.
No receiver needed. This works. When you click the link it tries to “view” the contents of the link so the intent-filter needs the view action and browsable category. And the correct data settings are listed below: