I am using Android 1.5
I am trying to download mp3 via URL link, but instead of download proccess I get auto-play via the webkit.
I do want to download the mp3 file, not to play it straightly from the browser.
Any idea how could I solve this?
thanks,
ray.
Send an HTTP Content-Disposition header, like this:
Content-Disposition: attachment;filename="file.mp3"
You can also set the MIME type to application/force-download, but that shouldn't really be necessary.
Related
My question is I have used many examples of http uploads of files for the android. They all seem to work except for video files that are .3gpp. I use the same code for .mov video files and it works OK. On the web side is just a PHP script. Does any know or have successfully uploaded a video (.3gpp) to a server? I don't get any error that I can see. The code I use also works for image files (jpg). It's just the .3gpp file type.
Thanks for any help you can give me..
isnt it 3gp
is it possible u are giving it the wrong extension?
i would say that the method u are using to upload should be pretty dumb to what files its uploading so it should work (as u said). the only other thing is i would try to match file size. so do a 5mb picture then a 5min video to ensure it is the file type causing the error
i would also say that maybe the 3 in the extension could cause problems (depending on how or what is reading it)
I have a url which directly downloads .pl file as xml on passing latitude and longitude within url. Now I have to first dowload it and then extract data from XML. However, i guess again and again downloading will not be a gud solution as it will make app slower. Hence, I was thinking is there a way where i can avoid downloading and make that xml directly open in browser and then parse it using SAX parser. Can I store it some variable or something similar and then can parse it?
Thanks
Astha
You need to download the data, which means retrieve the information from a distant server. What you could achieve is to try reading the file as you download it instead of downloading (ie saving in a temp file) then reading it.
It's the same idea as watching a streaming video (youtube ...) instead of downloading then watching a video.
I have no idea though on how to read directly a stream being downloaded.
I'm trying to load a aac radio stream and play it. For this I'm trying to decode the audio and play it using audiotrack.
I'm trying to use FFMPEG for this purpose. Is it possible to pass in the http url and ask ffmpeg's method av_open_input_file to open the http url? I'm trying to do this but its showing some errors while I'm compiling it.
Has anyone tried this. Is this possible?
Regards,
Hari
I have tested some apps on my droid. See the code for these apps here.
http://code.google.com/p/aacplayer-android/
https://github.com/havlenapetr/android_packages_apps_FMRadio
Which works perfectly well on my droid. Hope this helps.
I have a requirement of playing a Asx stream through an Android application
I have read the Android documentation, and they don't seem to support Windows Media streams
Is there any workaround possible? Has anyone did that before? If yes, is there some source code available? Or a library that implements this
Thanks
Are you worried about asx file only or any possible outcome after this?
The asx file can be readable as simple string, read the file using byte array and you can get one or many urls that can be
pls file
m3u file
mp3 url
wma url
We don't have to worry about 1,2 and 3. 1 and 2 can have different parsing logics but at the end they will give 3 [mp3 url] and an mp3 url can be easily handled by MediaPlayer api in android . but 4 is also difficult work to be done.
If found many tips about how to stream from classic url link, but nothing about ftp.
Is it the same way to proced ?
Thanks you.
AL.
Android's media framework only supports HTTP and RTSP for streaming. You will need to download your file and play it back, or use some alternative URL that offers HTTP or RTSP for the media file.
If you are looking for an app in android, there is a player for android which will allow streaming from a ftp server. it's called FIPE Video Player. It's free, neat and stream in high quality.
Update: another brilliant app (again if you are looking for an app) I recommend is ES File Explore, which also allows streaming from ftp server instead of downloading locally and then playing.
Just use VLC for Android and add your FTP as a source.
See : https://play.google.com/store/apps/details?id=org.videolan.vlc&hl=fr&gl=US