I have a cordova hybrid application and mobile web application. I came across a problem while application upgrade. Mobile web application works perfectly as all the static files which are modified are fetched from web server. But my hybrid application is not upgraded. I can push a new version to PlayStore or iTuneStore, but users has to manually update the application. Is there any way to update the resources(such as JavaScript, JSON or CSS) in assets folder? I gave a try, but failed. Assume that as part of a WebService request or push notification, I will get a list of files that are modified on the web server. How can I get these files in my hybrid app?
Please help if any of you faced the same problem.
You will need to check out the FileSystem and the FileTransfer APIs
I still did not get a concrete answer . But there is a tool called TriggerIO which offers this feature. Also PhoneGap cloud provides this for collaborative testing.
I believe behind the scene they may be using ApplicationCache to check for the resources.
Depends on your app usecase there is another way too. If you are okay for lesser performance, rather than packaging your static files along with the bundle, refer it from web. In config.xml, content src="mydomain.com/index.html". I use this for a specific product implementation.
You can remote update your hybrid apps with codova-app-loader, please refer https://github.com/markmarijnissen/cordova-app-loader.
Related
I am using Ionic and Cordova to build a mobile app which will go on the iOS and Android stores. I have done this many times, and I really hate the process of having to update the app (specifically with Apple).
Would it be safe to dynamically load all of my templates and controllers from my server when the app loads, potentially caching them or having a server call to check if there is a new version? Basically, I would have all images and styles saved locally to the phone, but load the templates and controller code on app load.
And, if it was ok to do programmatically, are there any rules against this in Apple or Android's terms of use?
This is possible and there are tools like Cordova Hot Code Push to help you accomplish it. As long as you don't use this to break other app store review rules or significantly change the purpose of your app it's fine with Apple.
This maybe a basic question, but I really wanted to ask it.
Consider a web application which is deployed on a cloud server and I want it to be available offline on a mobile(android device). Is it possible? Or will there be a separate installation on every mobile? How does phone gap or cordova help achieve it?
Yes it is possible. Cordova is an android application that has a webview (like a browser) for you to display an html app which is normally build with html+javascript. But cordova/phonegap applications should be made simpler than usual web application since smartphones has limited resources, unlike normal servers. There will be separate installation per mobile.
Phone Gap, Cordova etc. build native application, each user must install it to work offline. You can also build such native application manually by yourself with WebView. It can be easy to build but may require to changes in business logic to separate handle offline case, like store data locally and then sync when go online - this depend of application.
I need to create an application that does the following:
Is available for Android and iOS devices primarily, Windows phone support would be nice
Allows the user to use the app offline
Allows the user to download files (PNGs and HTMLs) from a webserver to be displayed later within the webapp (needs to be able to be viewed offline)
Doesn't require user to redownload all the PNGs and HTMLs if they clear their browser cache (would be nice if there was a way to keep them from clearing the web app cache too, but I understand if this is not possible)
What tools do I use for this? So far, I'm at HTML5 web app and I understand how to cache the site, but how do I get the files (PNGs and HTMLs) to be saved locally and not subject to being cleared should the user clear the browser cache? Is native for iOS, Android, and Windows the only way to go here?
Any help is appreciated...
If you want your app to work on multiple platforms and be available offline, your best bet would be to wrap your app in something like PhoneGap and package it up for the various platforms.
This allows for one common "HTML-based web app" code base but will require compiling for the different platforms respectively.
Here the story: I was developing a mobile application for my MSc project. Thi application was relying on an open dataset on the website www.kasabi.com, a marketplace for open data.
It was everything perfect until they ended up saying "we're gonna shut down the website".
You can understand that now I'm quite....well, I let you imagine.
the dataset is still available and downloadable so what I have now is: A server on Amazon, a backup file of the kasabi dataset (triples) and...nothing else.
I looked around for tutorial on how to develope semantic web applications, but I still don't have any idea on how to use this backup file in order to set up a triplestore and make it accessible from my android applications.
suggestions?
You could try using Apache Jena on your server (if amazon allows this):
http://jena.apache.org/index.html
Then you can access data in in a similar way to what you are used to in kasabi.
But you might like to have a look thorugh Which Triplestore for rapid semantic web development? , possibly Sesame would suit you better (http://www.openrdf.org/)
I'm trying to get setup to do mobile development using phonegap so i can deploy my application in android store and apple store. It's my understanding that I can simply wrap my application in phonegap so I can deploy for Android, iOs, BB, etc.
My application is an ASP.Net MVC app written with VisualStudio. All of the examples I've read through in my research tells you to use Eclipse for PhoneGap and Android, use XCode for PhoneGap and iOs. My app is ASP.Net MVC that produces Html 5. Is it possible to use PhoneGap with VisualStudio to produce Android and iOS deployable phonegap apps?
One alternative I've been thinking about is creating a simple Index.html page that uses jQuery to make a call to my ASP.Net MVC app and load the resulting HTML inside a div. Then I can simply reproduce this very lightweight Index page in Eclispe, XCOde, etc to run through Phonegap. This seems like a hack though. I've tried getting this to work but have not had any luck in the Android emulator in my windows environment.
Can someone please point me in the right direction for how to incorporate PhoneGap with my ASP.Net MVC app? Thanks.
ASP.NET lives on your server, so anytime you reference any ASP.NET script, you'll have to make the URL an absolute one with a hostname: http://www.example.com/my-script.aspx. Any non-dynamic files should be stored locally on the device so they will function when there is no network connection. You can then just host the dynamic files on your server and reference them whenever you need to. To keep data transfer size as small as possible, I generally pass JSON or something similar to the app. from my server-side script and then interpret the data into HTML in the JavaScript code for the app.
You should keep as many assets as you can local on the device so it doesn't require an internet connection to use the app. So don't link to a remote version of jQuery, save it as a part of the app. package you create so it's always available.
Eclipse/Xcode are nice because they help you create your app. and package it properly for submission to app. stores. They are also nice because of how easy it is to find help using Eclipse or Xcode to create apps. Xcode is actually required, Apple makes sure you have bought the latest hardware and the latest software just to be able to submit an app. to the store.