Forum Post: RE: View PDF on an Android mobile app. Any ideas?

  • Thread starter Thread starter Ricardo Perdigao
  • Start date Start date
Status
Not open for further replies.
R

Ricardo Perdigao

Guest
Yes, both approaches uses a browser to open a PDF within a mobile application. The one I've sent you worked on a Workshop last year. The actual code checks if you are running on IOS or Android. If on IOS, I just open the URL with a browser. If on Android, I had to use the plugin to invoke the URL with a different browser for it to work: function open_pdf_file(){ var devicetype = localStorage.getItem("lv_devicetype"); if (devicetype == 'apple') { window.plugins.childBrowser.showWebPage(urlpath, { showLocationBar: true,showAddress :true}); } else { window.open(urlpath,'_system'); } } The challenge I've found with opening the PDF with a browser on Android is that the default Android browser for a Mobile Application did not support PDF. It seems that Android have more than one browser installed and when you call a URL from within a Mobile App, it opens with a Browser that don't support PDF. If you go to the Browser Icon and paste the URL, that browser supports PDF.

Continue reading...
 
Status
Not open for further replies.
Back
Top