Monday, November 30, 2009

Create Mega Android Playlists from PC

Wanting to create a large playlist for my HTC Hero android based phone, I found out this is a fairly painful task since the obvious method involves adding songs one by one!

Fear not fellow androiders, here is how to create mega playlists easily (although it does involve typing a command OMG :) )

1- Plug in the phone over USB. My phone appears as drive G:
2- Open a terminal window, and "cd" into the Folder containing the music you would like to make a "playlist". In my case

cd MP3/80sMusic

3- Here comes the magic

dir /B > 80s-best-Music.m3u

4- Et voila, the terminal window exits, safely remove your USB disk, turn off the USB connection from the phone and that is it!

Addendum for Linux users
1- Mount your phone on some directory, and "cd" to it. In my case

sudo mount /dev/sdb1 /media/androidy
cd /media/androidy

2- Create the playlist file

cd MP3/80sMusic
ls > 80s-best-Music.m3u

3- Eject and Et voila. It's really almost identical to the Windows case

cd / ; sudo umount /media/androidy

I was pleasently surprised to find that in Android ALL music apps share the same playlists. So that newly created playlist is seen by the built-in Music application, as well as with the 3rd party Music player MixZing. It is also pleasantly surprising that Android seems to scan the whole folder structure for the .M3U files wherever they may be and use them as playlists! Sweet


Joe said...

Hmm, 'drive g'? - I take it you're a ms windoze user. Hey that's cool, but I'm not all that familiar with ms windoze, so how about a guide for linux users?

Ahmed Kamal said...

Hi Joe,
Not really a windows user, but I happened to do that one on a windows box. I thought it would be obvious for Linux user what needs to be done ;) But since you asked for it, I added an addendum with specific Linux instructions.

Hope that helps, enjoy

Scarr said...

Hook up the Android via USB as above.

Mount the device. Ubuntu does this automagically.

from terminal:

cd /media/disk { Or where you mounted drive }

find ./ -name "*.ogg" >> myfiles.m3u
find ./ -name "*.mp3" >> myfiles.m3u

cd ~
umount /media/disk

jdeslip said...

You could also just use Banshee - syncs your music collection and playlists to android in a snap...

Kenneth said...

I've been trying to do the unix version of this on the phone (using ssh on my HTC Hero) and the playlist doesn't show up on the lists of playlists, and if I browse to file and taps it I simply get a notice that the player doesn't support this type of file.
I can't seem to find the location of a playlist I've created in the player.
Do you have any ideas?

Ahmed Kamal said...

Are you sure the file name is .m3u
and that files don't have the path ?

I usually use a music player with the name "mixzing". Could you test with that

Things really just worked for me. If you've rooted your phone, this might change things too. I haven't

Kenneth said...

Hi Ahmed,

I figured it out :)
Switching to MixZing didn't help, so the next thing I tried was to delete the files, mount the sdcard in windows, recreate the file there, umount the sdcard and voila - I had the playlist (just with a few errors due to danish characterset).
I checked privileges on the file and the layout of the file and it looked the same as for the one it didn't pick up, thus I tried once more.
Removing the playlist file (didn't remove the playlist - so it must read it and save it to it's own library somehow) and recreating it againg in the linux shell on the phone and mounting and umounting the sdcard as it seems as if it this operation that causes the sdcard to be rescanned - and it worked (and now with the characterset errors).

Btw, my phone isn't rooted, I've just accessed the shell with ConnectBot

Thank you very much for your help and time.

Ben said...

Thank you! Command line method always appreciated and preferred. Worked like a charm on Fedora 13 to Moto Droid.

Saulo said...

Hi Guy.... You´re a Genious!!!! Great Trick... TKS so much!!!