launching m3u playlist with intent

by Seb » Sun, 16 Aug 2009 21:11:31 GMT


Sponsored Links
 Hi,

Is there a way to launch a playlist whith intent?

I can retrieve the path of the m3u playlist with:
Cursor cursor = context.getContentResolver().query
(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,
null);
cursor.getString(cursor.getColumnIndex
(MediaStore.Audio.Playlists.DATA));

But, I can't launch this m3u file neither with Intent nor with
MediaPlayer.

Is there a way to do this?

Thanks in advance


--~--~---------~--~----~------------~-------~--~----~



launching m3u playlist with intent

by Marco Nelissen » Mon, 17 Aug 2009 03:23:56 GMT


 


No.


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


launching m3u playlist with intent

by Marco Nelissen » Mon, 17 Aug 2009 03:30:16 GMT


 Well, OK, that's not entirely true. While you can't play an arbitrary
m3u file, you can play playlists that are in the database (which may
have come from m3u files originally, in which case there path is in
the _data column).
To see how, you can look at what happens when you put a shortcut to a
playlist on the home screen and then launch it.







--~--~---------~--~----~------------~-------~--~----~



launching m3u playlist with intent

by Seb » Mon, 17 Aug 2009 21:36:13 GMT


 Hi Marco,

Thank you very much for the response. You give me the key to find the
solution.

I had to study the code of PlaylistBrowserActivity to find the
solution.

I give it here if someone else search the solution:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setComponent(new ComponentName
("com.android.music","com.android.music.PlaylistBrowserActivity"));
intent.setType(MediaStore.Audio.Playlists.CONTENT_TYPE);
intent.setFlags(0x10000000);
intent.putExtra("oneshot", false);
intent.putExtra("playlist", playlistid);
startActivity(intent);

and to retrieve the playlistid:
Cursor cursor = getContentResolver().query
(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,
null);
if (cursor != null) {
 if (cursor.moveToFirst()) {
  do {
     playlistid = cursor.getString(cursor.getColumnIndex
(MediaStore.Audio.Playlists._ID));
     playList.add(playlist);
     } while (cursor.moveToNext());
     cursor.close();
 }
}







--~--~---------~--~----~------------~-------~--~----~



launching m3u playlist with intent

by hav...@gmail.com » Fri, 11 Sep 2009 16:12:32 GMT


 Awesome. I love you! :)
This was just what I was looking for.







--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Treoroid - cupcake on Treo650

Hello,

Recently I've succeeded to launch cupcake on my Treo650, it just
displayed home screen though.
So let me share my kernel and cupcake image to people who has interest
to do same thing. :)

Kernel image: http://ifile.it/qmyc94k
RootFS pkg: http://ifile.it/sec4lvm

The deployment procedure is almost same with below link, pls use my
kernel image and rootfs package instead of those.

http://hackndev.com/node/212

Also let me upload a screen shot for the home screen.
http://ifile.it/e8l6gkp
# I know that's out of focus, but my camera is over 5 years old..

Have fun!

- wby

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Building launcher.apk from source code

Hi guys,

I am trying to build the launcher.apk from source so that I can test
and modify some of the classes inside as part of a project. I imported
the whole launcher.apk folder into Eclipse and I can't seem to solve
the "R cannot be resolve" issue, and hence I cannot compile it. May I
know if anyone here knows how to compile the app in this case?

Thank you!

Cheers
Zi Yong
--~--~---------~--~----~------------~-------~--~----~

3. A new way to promote and manage your Android Applications!

4. Request to official ADC2 team.

5. modify asset such as a .png

6. XML vs. 'in code' created ImageButton in 1.6 looks different

7. Audio Settings Permission Denial