[android-developers] Re: Save an mp3 from a remote site

2009-03-31 Thread MrChaz
Sure, Something like //Where the file comes from URL sourceURL = new URL(address); URLConnection conn = sourceURL.openConnection(); InputStream inStream = sourceURL.openStream(); // Where the file is going to go FileOutputStream outStream= new FileOutputStream(sdcard/file.mp3); //a read

[android-developers] Re: Save an mp3 from a remote site

2009-03-31 Thread iDeveloper
Thanks a ton. Didn't know android allowed saving to mp3 directly unlike an iphone. On 31-Mar-09, at 5:32 PM, MrChaz wrote: Sure, Something like //Where the file comes from URL sourceURL = new URL(address); URLConnection conn = sourceURL.openConnection(); InputStream inStream =

[android-developers] Re: Save an mp3 from a remote site

2009-03-31 Thread Streets Of Boston
This is just copying the file. The question remains if you can play it or not... :=) I have not looked into this at all, but DRM could prevent the mp3 from playing. On Mar 31, 9:55 am, iDeveloper ideveloper...@gmail.com wrote: Thanks a ton. Didn't know android allowed saving to mp3 directly  

[android-developers] Re: Save an mp3 from a remote site

2009-03-31 Thread Jean-Baptiste Queru
No problem playing an MP3 from the SD card. You should be able to ACTION_VIEW the file:/// URI directly, or invoke the media scanner on it and ACTION_VIEW the resulting content:// URI (added bonus for the second method is that the file will immediately show up in the music player as well). JBQ

[android-developers] Re: Save an mp3 from a remote site

2009-03-31 Thread MrChaz
Good point, I forgot about the MediaScanner. One thing to note about using ACTION_VIEW is although you get the nice mediaplayer UI it doesn't keep playing when you change Activities e.g. go back to the home screen. On Mar 31, 3:57 pm, Jean-Baptiste Queru j...@android.com wrote: No problem