0

I am trying to write a music app very similar to sound cloud where users gets to upload their own recording and share it with other users.

Please kindly advise what are the options i have.

I have explore several option sounds as google drive, dropbox etc. but it seems to me that their services is more for individual user to stream their own drive instead of sharing their media for other users to stream.

Community
  • 1
  • 1
user2760642
  • 137
  • 1
  • 9

1 Answers1

0

The simplest solution would be to upload music files to the HTTP server and then in your Android application download a particular music file using HTTP request. You can then play the file either with some custom player or with anything available on the device by firing an intent:

Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(
    Uri.parse("file://"+ file.getAbsolutePath()),
    "music/*");

It would probably be nicer to be able to use a stream player which will be able to start playing a file before it's fully downloaded. Android's MediaPlayer might be a solution here: http://developer.android.com/reference/android/media/MediaPlayer.html

haaawk
  • 330
  • 1
  • 8
  • if i am using the media player, how do i make the resource available offline without actually downloading the file? – user2760642 Aug 08 '14 at 11:45
  • i think a more accurate way of asking is how do you cache the buffer of the loaded uri resource for offline usage? – user2760642 Aug 08 '14 at 11:58
  • You can use ContentProvider to store data on the device. You can use data stored there offline. – haaawk Aug 13 '14 at 08:25