I am developing an application which plays audio files from my server where I've uploaded them. The problem is that only those files play which don't have a space in their file name and files having a space in the file file are not being played. For example, I've two words.
word1=cricket
word2=play cricket
http://mydomain.com/games/cricket.mp3 is playing sound
http://mydomain.com/games/play cricket.mp3 is not playing
Every word which have space in it is not being played. What's wrong in my code?
MediaPlayer mp = new MediaPlayer();
try {
mp.setDataSource(url);
mp.prepare();
mp.start();
}
catch (Exception e) {
e.printStackTrace();
}