Reputation: 755
I need to play long audio files using the Android SDK. I am aware of the MediaPlayer framework shipped by Android, but I was wondering wether the built-in "Music Player" application could be invoked, so I don't have to write my own player GUI and code.
Upvotes: 1
Views: 2296
Reputation: 9127
Yes, you can.
Set up an intent like this:
act=android.intent.action.VIEW dat=file:///mnt/sdcard/song_name.mp3 typ=audio/mpeg3
Action: VIEW
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri .parse("file:///mnt/sdcard/song_name.mp3"), "audio/mpeg3"); startActivity(intent);
Upvotes: 4