Alpha Anywhere now supports the Cordova-Open PhoneGap plugin. The Cordova-Open plugin is used to open a file with its associated native app. For example, a PDF file can be displayed using the native PDF viewer on the device or a .mov video file can be watched using the native video player. Files can be loaded from either the mobile device's filesystem or a remote server.
Imagine an app used by a team of service reps who make on-site calls to repair equipment. The equipment at each job site may be different, and the service reps may need access to documentation (PDFs, videos, Word documents, spreadsheets, etc) for the equipment to consult on-site. Additionally, the documentation needs to be accessible offline because there is no guarantee that connectivity is available at each job site. This means the documentation must be downloaded and stored on-device before each service rep leaves the office and viewable on-site without needing to connect to a server.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