
Imagining the Possibilities for Offline-Enabled Mobile Apps
Alpha Anywhere includes the ability to download and store large amounts of data - videos, PDF documents, databases, etc - on the mobile device using the PhoneGap - File download Action Javascript. However, providing the capabilities to view these files in-app required extending an Alpha Anywhere application to include the ability to open PDFs, play videos, load Word documents, and open spreadsheets.
With the addition of the Cordova-Open plugin, including support to view various files within a PhoneGap application is no longer necessary. This opens up a whole new class of offline accessible mobile apps to Alpha Anywhere developers. Now, native apps on a mobile device can be leveraged by applications created with Alpha Anywhere to view files.
Taking Mobile Apps to the Next Level With Cordova-Open
A mobile application that supports storing files offline and viewing files using native apps can be built using Action Javascript. Only two actions are needed to create this functionality:
- PhoneGap - File download - Download and store a library files on the mobile device that can be accessed while offline.
- PhoneGap - Open File with Native Application - Display a file located either on the device or on a remote server using the associated native application.
Using the PhoneGap - Open File with Native Application Action to View PDF Files in a Mobile Application
The PhoneGap Cordova-Open plugin allows you to open various file types using the associated native app on a mobile device. For example, if you open a .pdf file, the PDF file is displayed using the native PDF viewer app on the mobile device. If you open a .mp4 file, the video is displayed using the native video viewer on the device. A common use case for this plugin is to download several files when a connection is available so that the files can then be viewer later on when no connection is available.In the video below, we show how to build an application that displays a list of PDF files stored locally in the device's filesystem. Each file is opened using the PDF viewer on the mobile device using the 'PhoneGap - Open File with Native Application' Action Javascript action. Because the PDF files are stored in the filesystem on the device, they can be viewed even if the device has no network connection.
Viewing Reports in PDF Format on a Mobile Device
Alpha Anywhere's report writer can save reports as PDF files. Using the Cordova-Open plugin in tandem with Alpha Anywhere's report writer, you can build applications that generate and display PDF reports on a mobile device using the native PDF viewer.Watch the video below to learn how to use the 'PhoneGap - Open File with Native Application' Action Javascript action to display a PDF report on a mobile device using the native PDF viewer. The video explains how to generate and download a PDF report to a mobile device. The PDF report is then displayed using a mobile device's native PDF viewer using the 'PhoneGap - Open File with Native Application' action.
Comment