Reading an excel file using cordova in ios - ios

I am currently working on a hybrid app for iOS. I am using Ionic/Cordova to make it. It's my first time using it.
I want to be able to read an xlsx file that is currently on my iPad and show that data in my app in a table format. I have read about the ngCordova file plugin at http://ngcordova.com/docs/plugins/file/. I have also read about AlaSQL.js at https://github.com/agershun/alasql. Can I use these together to do my task? Or should I use one over the other?
I find the documentation for the file plugin to be a bit confusing. Can someone give me a pointer or example of accessing the file and outputting it?
Thanks!

try to use file plugin to retrieve directory list and fileOpener2 plugin to open xlsx file.

Related

Make pdf file accessible through a link in the app

I've been searching for weeks on stackoverflow and google, but I wasn't able to find any good results.
I have a pdf file on my computer and I want to access that pdf file from an ios app, by clicking a link which will take me to that pdf file.
And when I modify that pdf file on my computer I want the link in the app to update with the latest version of that pdf file.
I thought of using a backend for storage such as Firebase storage but I had some issues with that.
How can I access that pdf file from an app? It doesn't have to be through a link, anything that will allow access with the latest version of the file is fine.
I appreciate any suggestions.
Thank You
The simplest way may be using a cloud storage such as Dropbox, Google Drive, One Drive...etc and get the public share link to that file. Then you can load the PDF in your iOS app using this link.
You can do this using web services API, You need to create simple webservice in backend (in any language for example PHP) to get the list of file with path to access in mobile app, and configure backend webservice code to your server (your computer, wherever you want to update files), So you can get every time updated data (files path) using webservice.

Where to store json file in ionic for ios?

I need to ship my application with a json file. The angular code then needs to read the json file and output the result into a view. I am very new to ionic and looked at the cordova-plugin-file plugin, but I am still not sure where to upload the file in my project. So the issue is that I don't know where to upload the file and how to read the same file. Any help or example code is appreciated.
I found the answer in the following post:
http://www.raymondcamden.com/2014/07/15/Cordova-Sample-Reading-a-text-file

Download FTP directory contents to ios

I have a website, let's say it's "http://www.jwilkthings.com/stuff"
I have a bunch of .txt files stored on this website, i.e. "http://www.jwilkthings.com/stuff/text1.txt"
What I'm wanting to do is find a way in iOS to download all of those text files without knowing what the document name is. I can already retrieve them manually as long as I have a file name, but I would rather just get all of them at once and put them in the documents directory if possible. I currently use FileZilla to upload all of the text files, so I can use FTP if needed.
The correct way to solve this problem is to not use FTP (riddled with performance and security issues), and to configure your web server to expose a table of contents directory listing that your client can parse.
But that's not an answer to your question.
If you really want your iOS app to speak FTP, take a look at the SimpleFTP sample project from Apple.
It's old, but I just got it to build on iOS 5. The ListController.m file has the code you're looking for.

Save images phonegap query iOS (url in xml)

I'm sort of stuck with a iOS / phonegap question.
I have a XML on the server which I download successful with ajax. I even save the XML in the local storage and can read it later when offline.
The next step is the one where i need a startup. Within the XML I've got image URLs. I would like to download them and save them locally.
What is best practice and also the quickest way?
Do i need the FileWriter plugin for that? Or do i need to save them in a database as base64?
And after that how can i read them to show in the application?
Thanks in advance
There is no simple way as far as i can tell. You may wish to try using the cache manifest, or downloading them using code such as this: http://blog.clearlyinnovative.com/post/2056122828/phonegap-plugin-for-downloading-url-all-the-code
Full project here: https://github.com/aaronksaunders/FileDownLoadApp
Good luck

Exporting files from a Javascript based phonegap app - options or ideas?

I'm currently writing a mobile app (hopefully iOS or android) using the jquery mobile framework and phonegap.
It'll need to export/send csv files in some way to the users, but I'd be interested to hear ideas or suggestions about the best way of doing so. If this can be done on the js side of the app that'd be ideal as it's what I'm most familiar with. A couple of options I've considered are:
Uploading the file using the google docs api
Writing the file to the file system (then export e.g. via iTunes)
I'm new to this so any suggestions gratefully received! Thanks for your help
There are a few options that you could use depending on how you want it to work.
The main options would be to
Use the File API (http://docs.phonegap.com/phonegap_file_file.md.html#File) to store files on the filesystem of the device.
Upload the file to a server using a standard XMLHttpRequest.
Write a native PhoneGap plugin on each platform that you are interested in that could connect to Google docs.
As Dave pointed out you can write files with the FILE API. I have used the file api on iOs to write custom log files and havent found any yikes so far.

Resources