Can I include HTTP headers in a Google documentation request?

I am working on an Adnroid application that needs to read a remote PDF file and open it, I saw that google docs can do the conversion from pdf using this URL:

http://docs.google.com/viewer?url=

The problem is that my url to extract the file requires adding a header to the http request. Can someone tell me how this can be added to the google docs call?

+8
android header request
source share
2 answers

Secret of HttpClient .

View this example in cookies - it is different from the headers, but you can use the same object to set them. This is a pretty good piece of code.

Google, if you have additional questions - as soon as you know what to use, it was easy for me to find the specifics I needed.

0
source

I didn’t get your problem exactly what you want to say, but here is the same thing that I did to download the PDF inside the web browser: Android - downloading the PDF / PDF Viewer , this can help you.

From your comment below, I can suggest you think of one scenario:

1. if(network is available) { // load pdf in google docs. } 2. if(network is not available) { //load pdf in third party application which is already been installed in your phone. } else { //Give Alert message that you cant view pdf this time. or whatever message you want to display. } 

Give error message

0
source

All Articles