This is a migrated thread and some comments may be shown as answers.

Opening a file in a hybrid app

2 Answers 166 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Novern Holder
Top achievements
Rank 1
Novern Holder asked on 10 Mar 2015, 11:07 AM
Good day,

I'm struggling with an issue here.
I download a file from a WebAPI then save the file locally on the device, but after this I want to open the file (Specifically PDF at the moment but I would like to be able to expand this to any file type).
Has anyone actually done this?

Here is a plugin I think would work, but I'm not to sure how to include the .java file in a telerik solution.
(https://github.com/markeeftb/FileOpener)

Thanks in advance!

2 Answers, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 12 Mar 2015, 02:28 PM
Hi Andre,

To open a pdf file on iOS device you should use the InAppBrowser plugin as in our sample app. On Android, the app attempts to open the PDF file in the default browser and the browser launches the default PDF reader app so you need such reader installed.
For your convenience I slightly modified this sample in order to download pdf file and open it.
However this could be an option when you attempt to open pdfs and images.

If you want to open different type of files you can try with the plugin you have found and to do that you will have to import it as described here.
I don't know how reliable it is but notice that it is designed for Android platform only.

Regards,
Zdravko
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Novern Holder
Top achievements
Rank 1
answered on 13 Mar 2015, 11:28 AM
Thank you kindly, will give this a look!
Tags
Apache Cordova
Asked by
Novern Holder
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Novern Holder
Top achievements
Rank 1
Share this question
or