Android Question Music Random Pick

NoamXx

New Member
I'm using the trial version, I want to try and make a program that picks out a totally random song out of an unknown song list with unknown songs. Like shuffling a pack of cards that you don't know what will come out.
I thought of using Rnd() for getting a number of song and playing... But it doesn't work... Help?
 

DonManfred

Expert
Licensed User
Longtime User
See this example on how to build your own playlist, how to shuffle a list. Hopefully it helps you with ideas/sample code

PS: Welcome to B4A-Community!
 
Upvote 0

NoamXx

New Member
See this example on how to build your own playlist, how to shuffle a list. Hopefully it helps you with ideas/sample code

PS: Welcome to B4A-Community!
Thank you for the enlightening welcome!
However, I don't understand the part in the code :
playlist.Add("A")
Through
playlist.Add("Z")

Are these the names of the songs? Or are these the initials of the songs?
Thanks,
Noam
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Thank you for the enlightening welcome!
However, I don't understand the part in the code :
playlist.Add("A")
Through
playlist.Add("Z")

Are these the names of the songs? Or are these the initials of the songs?

It´s just an example of Songnames to show the principle of the Routines.

Using Fleedwood Mac as Group it could be

playlist.Add("Gypsy")
playlist.Add("Dreams")
playlist.Add("Insane")
playlist.Add("Peacemaker")
playlist.Add("Gold dust woman")

or using The BEatles

playlist.Add("Help")
playlist.Add("It´s a hard days night")
playlist.Add("Yesterday")
playlist.Add("Yellow Submarine")
 
Upvote 0

NoamXx

New Member
It´s just an example of Songnames to show the principle of the Routines.

Using Fleedwood Mac as Group it could be

playlist.Add("Gypsy")
playlist.Add("Dreams")
playlist.Add("Insane")
playlist.Add("Peacemaker")
playlist.Add("Gold dust woman")

or using The BEatles

playlist.Add("Help")
playlist.Add("It´s a hard days night")
playlist.Add("Yesterday")
playlist.Add("Yellow Submarine")
This is the exact problem, I want it to choose a random song out of a random set of songs [which are all of them] on the phone.
Though, is it possible to retrieve all the songs onto a listview with checkbuttons? [Sorry for giving you a headache :\]
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Did you know where (path) the music-files are?

you can read the directory-listing to retrieve the files inside this folder... Then you have a list of musicfiles... But then you dont have a mp3-player. You just have "some strings".... There is more to do for an complete mp3-player
 
Upvote 0
Top