I am trying to create an app that can download music files, .mp3 to be precise, from the server.As I am a rookie in this Android Development field so I will appreciate any h
You can do it this way:
try { MediaPlayer player = new MediaPlayer(); player.setAudioStreamType(AudioManager.STREAM_MUSIC); player.setDataSource("http://xty/MRESC/images/test/xy.mp3"); player.prepare(); player.start(); } catch (Exception e) { // TODO: handle exception }
Manifest permission: