Downloading and saving files with AIR for iOs - ios

For a project we need to download and save pdf files on an IPAD device for offline use through an AIR for iOs application.
After a lot of searching I haven't found much information on this subject. My question is, can it be done, and if so, can you provide us with some pointers to lead us in the right direction.
Thanks for your time!

Sure, first you check if you can access the web - can use a class like air.net.URLMonitor, if you can you can set up a URLStream instance.
You get data while its downloading the file using the progress event, write that out to a File instance using the FileStream class.
To display the PDF file you can use a StageWebView or HTMLLoader.

Related

Working with custom user files

I'm currently studying swift and came up with such a question:
What are best practices to work with custom user files like .pdf, .doc?
For instance, I have application, that loads different files from server like .pdf, .ppt, .zip and so on, how to present them inside my app?
While googling I came up with solutions mainly for images, but nothing particular for other file types.
For now, what I have is - downloading files from server using Alamofire and saving them to documents directory.
Could anyone please recommend how to present this files inside my app after I saved them?
Possible solution that comes to my mind is web view, but what about zip? Is there some kind of universal solution? I know that there is Files App in iOS 11, but what about iOS 10?
Many thanks for your attention!

WKWebView File System Browser

I've been asked to add a file browser to an existing Objective C application that uses a WKWebView to load up a Javascript internal app.
Currently we have the capability of looking at the pictures on device to upload images into the app, but I've now been asked to do the same with more generic file types, specifically PDFs.
What I've read so far is that this is only possible if a file is stored in a specific part of the file system and only if the app knows exactly where the file is to begin with, but what I need is the capability to browse to a certain degree.
What I'd like to know is whether this is possible and if there is a good place to start on that?
Thanks.

How to display a .pdf on BrowserField in Blackberry 7

I'm trying to display a .pdf file on a browserfield but somehow it's not opening in my app however it works fine with .txt files.
I'm reading .pdf file from local storage and using
browser_field.displayContent(fileinbytes, "application/pdf", "");
but it's displaying a player like image on the screen and not actual result.
If anyone has any idea about the same, i'm all ears.
As far as I can tell this isn't possible (browserfield doesn't even fully support javascript).
This post suggests that you can view it via Google, which wouldn't be from local storage.
(Un)luckily blackberry is very similar to Java ME, so you can often use those libraries as is. Apparently JPedal can render pdf files for J2ME, and might be worth a look.
Other than that, I don't think you'll have much hope. Good luck

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

Ipad DWG/DXF viewing

I have seen applications for iPad that let you view dxf and dwg files.
Does anyone know where to get info on how to do this? Are there any available tutorials? I haven't been able to find any.
I really need some direction on how to do this. The application I'm making just needs to show the files and layers.
Thanks for any help.
At present RealDwg is not available on iOS platform, so no way to view local dwg/dxf files.
But you have the other option. You create servers which open dwg files and send entities information in some format to your app, then your app can shows them. Through this way, your app can handle extremely large file. See AutoCAD WS.

Resources