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.
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.
I'm enjoying web development and I want to make an "app" to try my hand at mobile phone dev. Learning Java/AppleCode isn't feasible right now, so would it be possible to make a website that runs as an app on a phone? And have that app do the things people want apps to do, like integrate with your phone's calendar, receive notifications in the notification bar at the top (Android), etc...??
Yes.
Apache cordova will do the trick but you (of course) can't have php running, only html and javascript are supported (and the code in which the app is built).
Featueres :
Free :)
Code for multiple platforms in html and js.
Tons of plugins to do all kind of stuff for you.
Can (with a little modification of content security policy) load pages from a remote server.
Downsides :
Not the performance of normal code.
Only communication between app code and js is using callbacks, this results in true Callback Hell.
All app code runs asynchronously while js code doesn't.
Installation is not a simple .exe but an actual guide (i managed to screw it up, had to system restore to easily remove created files. But it should be rather simple).
Supported Platforms :
android
ios, can't compile for ios on non-apple though (thanks apple!)
browser (basically webserver)
windows
windows 8 app
windows phone 8
blackberry 10
and more...
Basically, I'm trying to make use of this website called PhoneGap that recives html codes and converts them into mobile applications.
So I'm trying to make an application that tells you how much money you owe people and how much money people owe you.
IS this possible?
HTML alone isn't enough to develop your application. It's a simple mark-up language and unable to create any real functionality. But HTML if used together with javascript (which adds the required functionality) will work great for building what you mentioned.
So if, for any reason, you'd prefer to not develop a standard native application (one which is installed locally on a user's device), then another option is to build a web-based application. These have much in common with typical websites (though optimized for mobile devices) and are generally easier to build. Another advantage is that they can run on almost any device that has a browser installed, and therefore not tied to any one specific OS, such as Android. Web applications - despite not being installed on the user device - can none the less make use of local storage to save data. This is one example for when javascript is needed.
Here is a great resource for learning about javascript: http://www.w3schools.com/js/
You should read about HTML5 and hybrid apps. A hybrid app is what you are after.
Yes, you can use html to build an app with Phonegap, but you'll need JavaScript too.
I suggest the following technologies for you: Ionic, Angularjs and localStorage for recording the data.
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.
Is there any way of developing a mobile app as a self contained Rails/Ruby app?
The idea is to develop in Rails using the normal tools (browser, thin/WEBrick and command line) and then add the Rails app folder to a specially created Android/iOS app, from where it will be compiled to a native executable. This would be similar to the current PhoneGap creation process I guess. I know about RubyMotion but its iOS only, and its not completely Rails anyway.
Does anything like this exist currently?
What would you need to do this? Obviously you need to run a local webserver of some kind.. Do you need to run an entire stack (Apache, Ruby and Rails) inside the native app or could you take shortcuts (like JRuby for Android for example)?
What is your gut feel on how this would perform?
Any thoughts welcome.
EDIT
Gems are probably going to be a BIG issue as well.
Does anything like this exist currently?
Rhodes is in the ballpark, but it is not Rails and (last I checked) cannot use gems. It does, however, have you build so-called hybrid apps using a Rails-ish controller pattern, with partials and all that.
Obviously you need to run a local webserver of some kind
Not necessarily, and it would be an poor idea to do so for security reasons. Hybrid apps, such as Rhodes, have a Web presentation layer (WebView) displaying the HTML content generated by the back-end, without an HTTP stack.
What is your gut feel on how this would perform?
On many devices, I suspect that your app would crash on startup for having run out of memory. On the rest, I would expect mediocre performance, simply because Rails is not particularly svelte.
The strange thing is that you want to use web application as mobile application. Is there a reason to use Rails instead of just Ruby (then you have Ruboto on Android). My opinion that HTML5(+ local storage) is enough to serve mobile part and use API from somewhere on the web.