• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting pdf files from webserver & display through our android application

 
kanna chowdary
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
here is my problem:


I want to get data from webserver which is in the format of pdf. And display it in my android emulator.

Is there a way to read pdf files and display it in our application on Android?... could you please give
me solution with sample code.

Looking forward for help ..
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have to install the Acrobat Reader program into your emulator, just like there's an Acrobat Reader application on my Android phone. To display the PDF, you'd have to launch the Adobe Reader program as an Activity.

Actually, I don't like reading PDF's on a small-screen device, since PDF's preserve the page size and it's typically business-page (letter or A4) size. So it's like trying to read through a keyhole.
 
kanna chowdary
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't mind

can you explain the steps for installation and with an example java code .

Wating for your reply.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kanna chowdary wrote:If you don't mind

can you explain the steps for installation and with an example java code .

Wating for your reply.


Take some time to read this: How to ask questions on JavaRanch and specifically show some effort and we are not a code mill sections.

As for your question, here's what you need to do(or find a way to do it): you can fetch the PDF file by opening the remote stream(for e.g: by executing a HTTP Get), read the data and persist it on your SD card(normal java File I/O). You can then launch a generic intent (ACTION_VIEW) and set the appropriate content type and data(Intent.setData and intent.setContentType) in your Intent object. The system will resolve the intent and find a suitable application that can cater to your need(display the PDF).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic