File Downloads in Android Web Browser

by Al » Tue, 22 Sep 2009 04:03:20 GMT


Sponsored Links
 For a little while now, I've been trying to figure out why I couldn't
download video files from the website i'm working with the Android OS
web browser, although I have found a work-around solution.  For some
reason, it seems as if the Android web browser (default OS web
browser) does not properly handle the "Content-Disposition:
attachment;" header from the webserver (in this case, Lighttpd).  When
attempting to download a file, all I was seeing with both HTC Dream
and HTC Magic (most recent OS version) was that it attempted to
download the file, but it couldn't detect the file name and the file
had no content.  Now after looking through the HTTP 1.1 RFC
documentation, I've noticed that they state that the "Content-
Disposition" directive is not part of the HTTP standard (Section 15.5
of RFC2616).

I thought that this issue was possibly due to the fact that no
attachment file name was being specified, but then I came across
another section in the Hypertext Transfer Protocol specification
(RFC2616) that states the following:

"RFC 1945 and RFC 2068 document protocol elements used by some
existing HTTP implementations, but not consistently and correctly
across most HTTP/1.1 applications. Implementors are advised to be
   aware of these features, but cannot rely upon their presence in, or
interoperability with, other HTTP/1.1 applications. Some of these
describe proposed experimental features, and some describe features
that experimental deployment found lacking that are now addressed in
the base HTTP/1.1 specification." (Section 19.5 RFC 2616)  As the
grammar for that directive shows (Section 19.5.1), there can be 0 or
more disposition parameters after the "Content-Disposition:
attachment" directive.  So basically, to remedy this issue, i've had
the "Content-Disposition: attachment" directive removed from the web
server, but what I'd really like to know is if this could possibly be
a bug with the Android web browser or if it's something the developers
purposely did because that directive is not officially part of the
HTTP standard?

If anyone could give me an answer on that, it would be greatly
appreciated!  Also, if I am getting any facts mixed up or if there is
something else i'm unaware of, please let me know.

Thanks

Al

--~--~---------~--~----~------------~-------~--~----~



File Downloads in Android Web Browser

by AJ » Tue, 08 Dec 2009 13:40:22 GMT


 Hi All,

I have problem in downloading the content when "Content-Disposition:
attachment" is specified in response coming from the server.

I searched the forum and found that earlier one guy also had the
similar issues. I am facing the exactly same problem which being
specified there.

Here is the link :-


Sponsored Links


File Downloads in Android Web Browser

by AJ » Tue, 08 Dec 2009 19:42:47 GMT


 i hope at least somebody would be having any idea on this.

Thanks,
AJ



> :-



File Downloads in Android Web Browser

by AJ » Wed, 09 Dec 2009 19:14:14 GMT


 ???






> > :-



Other Threads

1. AudioTrack and STREAM_MODE

Hi,

I need help from an expert of the audio stack.

I'm currently writting an opensource SIP application (http://
code.google.com/p/csipsimple/) based on a native sip stack (pjsip).

I've ported the audio driver for android (naive portage using JNI)
(the key file :
http://code.google.com/p/csipsimple/source/browse/trunk/pjsip_android/apps/pjsip/project/pjmedia/src/pjmedia-audiodev/android_jni_dev.cpp
).

Everything works well on HTC devices. But when run on devices from
other manufacturers things becomes instable (seems to be related to
the CPU load and/or frequency use for the stream).
The result is that on some device (sony X10, samsung galaxy spica,
galaxy S...), sometimes and after about 10 seconds of streaming, audio
track become totally blocked in its write method. No audio is streamed
anymore. And worse, flush and stop method does nothing.
AudioTrackTread is still blocked. And worse... then even if you kill
my app, no other app can use audio  : if you try to play music or
place a gsm call you'll have absolutely no sound.

After a lot of tests, and searches, I have some questions to make sure
I handle properly the stream mode.
I've read that we should always ensure AudioTrack buffer is never
empty. What will happen if audiotrack becomes empty? Can this explain
the fact it freeze audioTrack in my case? Same question when
audioTrack becomes full.

Another thing that should be clarified for me is the impact of the
audioManager settings on audio routing : I noticed that some settings
such as Bluetooth SCO is only taken into account if you stop audio
track and play it again (in my case, it's totally destroyed and re-
created, but I think that play/pause should be enough). Is there rules
about the fact we *should* pause/start stream before changing audio
settings? Other settings seems to work as expected while in streaming
(speaker, mute etc)... but I'm wondering if it's ensured in all
devices and if it is the good way.

Last thing for now, it's not really optimized in term of CPU (and some
codecs need a lot of cpu) can it be the reason of this lock in the
audio track write method?

To help you to enter my code (if you want to have a look - that would
be really nice :) ) :
It's an audio driver integrated in pjsip.
There is a method to create the stream :
    here I create an AudioTrack & a AudioRecord - taking as buffer
size the value given by minBufferSize
A method to start the stream :
    that callback a method from my app to set up audio modes
    that create a thread that play the track, goes in a while loop,
get a frame from sip stack and write it into the audio track
    that create a thread that play the record, get a record frame in a
while loop and transmit it to the sip stack
A method to stop the stream :
   that put flags to stop thread, join threads and stop track/record
A method to destroy stream :
   that release the track/record objects.


Thanks in advance for any help that you can provide :) (and sorry for
my poor english .. hope it's still understandable)



-- 

2. i haz an idea

ok so you know how some guy was able to run uclinux a while ago maby
we can take some of his work and use it to help us. I think it cold
work you know what the hell ur do ing

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Job Opportunity with very large Wireless Provider

4. Write Android Books - Packt Publishing

5. OpenSource REST Client for Android

6. Eclipse library project problems

7. Droid Froyo manual update