i Am struggling for a about 1.5 days trying to find a solution without success.
i want to download an entire directory that web content (images, html, js and css) to the persistent storage in an iOS PhoneGap app. I tried compressing the files into a single file and was able to download it to the persistent storage but i was not able to extract it. to extract the file i've tried multiple things none of them worked for me:
zip.js
archive.js
and phonegap-plugin-ExtractZip https://github.com/fiscal-cliff/phonegap-plugin-ExtractZip
does anyone have an example "unzip" function that i can use. or is there a better way to transfer a whole directory from a server to a phoneGap app?
(i am using cordova-3-3-0)
thanks in advance,
You need to develop app that integrate with restful service. You can download sample code from my github account.
https://github.com/datomnurdin/service-finder-mobile
Related
I want to upload files from my react-native based application on android and ios. I have tried several plugins but still, there are some problems regarding different NPM package. So, anybody here can help me with the problem.
I have tried several npm packages but they are beyond my expectations.
I want to select files from mobile devices and upload them to the PHP server. whether the files could be image and video.
Create PHP endpoint where you can post the images.
You can use this to get a video/photo from the library react-native-image-picker.
Send via https images to the server.
Is there a way to hold a large block of text, or images/videos, embedded in a FirefoxOS app, while directly accessing them from the app (similar to /res/raw/ in Android)? I don't see where the /data/ directory is being accessed in the example app.
There are many ways that you can do this:
Distribute your web app as a packaged app. In this scenario all your resource files are zipped up in a single file, available after install via a URL scheme described in the documentation.
The Application Cache allows you to instruct the browser to download files for offline use. I like Rob Hawkes' utility for generating appcache manifest files.
You can manage the data yourself by downloading the files via XMLHttpRequest and storing the data in an IndexedDB database or on the SD card via the DeviceStorage API.
I think that your best bet is the filehandle API, but more importantly keep in mind that a Firefox OS app is basically a website so you shouldn't be thinking as an android app that can carry it's media and so on.
Good luck
If you want to display images in a website you place images in the same root folder or sub folder. The same thing works with firefox OS.Place your images in your app folder and use them. If you want to use images from the mobile then you can use device Storage API .you can find the example here
I am creating a html5 and javascript web page that allows you to draw your own picture. The page itself works, but I want to make it so my web application will create a folder in their Appdata (or Application Data if they're on a mac) directory.
Then I also want to make it so when a user logs back on to the website, all of their work is saved and they can pick up where they left off.
So basically, I want to be able to create a file on a client's directory, then be able to download that file once they have saved a change to their drawing. Is there a way I can do this? Thanks.
All of these things can be done by using the HTML5 file APIs.
Here are some links which will help you with your task:
http://www.html5rocks.com/en/tutorials/file/dndfiles/
http://www.html5rocks.com/en/features/file_access
Storing state can be accomplished by using one of the following technologies:
Cookies
localStorage
indexeddb
WebSQL
I am using PhoneGap to develop an application for Android and iOS, and recently in a discussion about this technology, someone told me a seemingly brilliant idea that I can do background updates of my application without having to submit a new application to the app store.
The problem is that, being that I am still fairly new to the HTML5/CSS and Javascript world, I cannot figure out how to download files to my www directory for permanent storage. I can dynamically load JS code or HTML pages at runtime, but I want to create some javascript module that will find that a certain .css, .html, or .js file is out of date, download the new version of that file from some http or file server to the www directory, and then have that new file permanently saved so that it is available the next time the app is opened.
I feel like this should be simple, but I can't figure out how to do it. Thanks in advance.
In order to permanently save files to the devices you will need to make use of the PhoneGap File APIs. Periodic tasks can be achieved with a simple Javascript timer.
So these days we want things to be on the cloud.
In the desktop area we could use one application to create a file, then another to open that file.
I wonder how you accomplish this file sharing between web applications?
Eg. if I create a web application letting the user create a file, how do I share this file to another web application for opening it? Maybe the user created a PDF file on my web application and when he clicks on it, I want this file to be opened using another web application - but is not mine - so that he doesn't need to download it to open it.
Is there a standard way of sharing files between web applications easily?
Im not asking about pure technologies that could make this possible eg. REST/json, but standard specification/implementation for sharing files between applications. Cause I haven't heard of this kind of implementation, which could be good for cloud services to eliminate the need of having to download everything.
Application A assigns an URL to the file, hands the URL over to application B and application B uses HTTP to retrieve the file via the URL. If both applications are running on the same server, this will be just as efficient as reading from a file from the file system, or from a database.