What is the difference between jQuery Mobile and PhoneGap - javascript

I am developing a mobile application using jquery mobile. But using this I can only be left with my .html, .js and .css files. And In order to make it run in Smartphones, I need to create a stand alone application using toolkits such as PhoneGap. So, what if I develop the whole application using phoneGap instead of using jQuery mobile. Is it possible?

jQuery Mobile is UI Framework for building web application and PhoneGap is a JavaScript framework which allows you to access native device functionality.
For example consider cases.
Case 1: You can develop mobile web app using Jquery Mobile.
Case 2: If you want to access device hardware for native device
functionality, you have Phone-gap in addition to your UI framework
that can be anything not just jQuery Mobile. You can package it for different platform (like iOS, Android etc) i.e., an Hybrid App. Approach depends on your requirement.

There are two different things:
phonegap is used to run web application as mobile app it start a web view and run your website
jquery mobile is framework for website compatibility for mobiles
for writing phonegap app you need to write website, therefore tou can use jquery mobile to write this website
Phonegap also give you api for native functionality - phonegap home page

https://cordova.apache.org/
PhoneGap or Cordova use to build application through your web application. it is separate framework. they doesn't compare
You may change UI through native platform code. but you should not change. Already you have web project. You can access to platform features(camera, wifi, connection).

Related

How does Apache Cordova and ionic framework interact native-ly?

I'm trying to find out how does Apache Cordova & Ionic Framework work?
I searched all over the internet and all I get is,
it is a wrapper around html/css/js and it uses the native web view to interact with native feature. But, you still deploy the native-ly. (That means .apk for Android, e.g.)
But, what I'm interested in is
Is Apache Cordova and Ionic Framework entirely written in javascript?
How do they interact with native mobile platform?
Does cordova/ionic get bundled with .apk file to mediate between the native web view and source code?
I believe what I'm interested in bit of low level detail.
If anybody could shed some light or point me to the resource (which I couldn't find) , it'd be great.
Thanks.
Apache Cordova provides a basic native app responsible for:
Displaying a Webview (UIWebkit by default for iOS, but you can switch to WKWebkit using a plugin. For Android, the "android browser" webview is used up to Android 4.4. From Android 5 (API 21), the webview is basically Chrome for Android).
Allowing the JavaScript running into this webview to "call" (execute) native code thanks to Cordova plugins. This is possible because system Webviews can interact with native code.
Ionic Framework (v1) is made of HTML, JavaScript and CSS (v2 is developed in TypeScript, which is a typed superset of JavaScript). The version 1 relies on AngularJS as a frontend JavaScript framework and helps developers writing "native-like" webapps by providing features like Gestures management, Infinite scrolling, Layouts (Menu, Tabs, Lists...), etc. The version 2 relies on Angular 2 and provides additional components (Date picker, Split panel...) and features (Ionic Native, a JavaScript API which tends to "standardize" the way you use Cordova plugins).
Ionic can be used without Cordova, if you simply want to create a web app (this is still HTML, JavaScript, and CSS). Cordova allows you to put this web app into a native shell. When an hybrid app (Cordova, the plugins you installed, and your web app) is bundled into an .ipa or an .apk, the html/javascript/css codes are moved into a specific folder, where Cordova expects to find an index.html (by default) to load in the Webview.
PS: My english is not perfect but I'd be glad to give more details if a point is not clear.
EDIT:
Please can you answer my specific questions in my post?
Sure!
Apache Cordova is made of JavaScript and Native code. See projects like cordova-android (JavaScript + Java), cordova-ios (JavaScript + Objective-C). Each mobile operating system has a dedicated "platform". When you start a new Cordova project, most of the time, the first operation you do is cordova platform add <platform> (iOS, Android...). These are the codes being loaded. Ionic Framework is a "pure-web" framework, made of HTML, JavaScript and CSS.
Apache Cordova interacts with native mobile platform as any native app: using the system APIs. The webview can interact with both your web app (of course) and the native code, thanks to platform-specific "bridges" (the native code embedded in cordova-android, cordova-ios, cordova-windows, allows that). You have to write a plugin in order to call native code from your JavaScript. For Android, it consists in extending the CordovaPlugin class and overriding the method execute (for instance: cordova-plugin-splashscreen).
The .apk (android) or .ipa (iOS) generated by cordova build (if you're using the cordova-cli) gathers together both the native shell (cordova-android for Android, cordova-ios for iOS) and your webapp. At startup, the main activity/view of Cordova is instantiated, loads the webview, which itself loads your webapp.

Does Intel xdk / Jquery Mobile work with Parse.com?

If I build a cross-platform app using the Intel XDK or jQuery mobile, would I still be able to use Parse.com as a back-end to manage data in the cloud and push notifications?
Short answer is yes, but only up to the point, and to make it clear, I'm talking from jQuery Mobile perspective.
You application will use Parse.com REST API for communication but that's about it. Because you are creating a hybrid mobile app RESTFul (AJAX) connection is only viable solution.
You can of course go for some native solution, using Java (Android) or Objective C (iOS) but you will need to write your own wrapper code that will communicate with JavaScript. This is a bad solution because it brakes the point of hybrid mobile applications (One solution to rule them all).
To incorporate everything you will need Cordova (PhoneGap) as mobile app wrapper. From my knowledge, Phonegap plugin is still no go, so you will need to create your own implementation, which will not be that hard, if you take into account that Phonegap plugin for classic push notifications exist, and you can use RESTFul communication to feed it data.
Also, why limit yourself to those two frameworks? Faster, more native like frameworks exist, so choose wisely (find more information here). Application speed if your first and major concern.
Leave me a comment if you need more information.
Yes, Intel XDK is an HTML5 Development Environment to develop HTML5 Mobile Apps, you can use any HTML5 framework like jQuery Mobile and use Parse.com for back-end for data, for push notification you will have to install Cordova plugin, which is currently not supported in the current version, but will be available soon.

Can Titanium code runs in browsers?

I understand that not all the code and functionality are available. However, I am currently in the planing of a new project and there are no document to be found on this aspect.
I want to know once I code in Titanium, is it possible to make a web version for mobile without the application with limited feature and the same code base? (something like touch.facebook.com vs Facebook app)
Thank you very much
Of course, Titanium could do that since it also supports MobileWeb. Titanium features:
Develop native applications for iOS, Android, BlackBerry, Windows, and
mobile web through a single code base.
With their Titanium Studio, you can easily build and package your app for MobileWeb.
But there are a lot of things to consider on developing titanium apps. Here are the few things I've learned along the way:
Don't use ImageView. Use View with backgroundImage. If it's an icon, you can make a font for your app. See how to create an icon font using IcoMoon.
Memory management
Never use borderRadius, borderWidth, borderColor in components within components, as for example a ScrollableView.
Minimize calling Ti.Platform.[property_name]. Example: instead of always calling Ti.Platform.osname to your controllers, you could have put it on you commonjs var osname = Ti.Platform.osname, then exports.getPlatformName = function() { return osname; };
Here are some few references:
http://developer.appcelerator.com/question/152656/tips-and-tricks-for-memory-management
http://developer.appcelerator.com/question/116867/this-is-a-solution-to-your-memory-woes#answer-203729
http://www.tidev.io/category/howtos/
Titanium SDK supports iOS, Android, BlackBerry, Tizen and HTML5 platforms. You can read more about that in their documentation. You can limit features in HTML5 app in a code with simple if() and reuse most of your codebase.
You can create a web version of the application if you include Mobile Web in the target platforms, when you create the project.
To deploy it on the browser, run the application as Mobile Web.
You may refer the following links for more details.
Getting Started with Mobile Web
Mobile Web Platform Overview
Mobile Web Limitations

Is it possible to implement HTML5 (I plan to use WebRTC)as a WebView within a native Android application?

I am thinking about developing a android application to make a WebRTC call. Unfortunately the native WebView in android does not support such feature. I tried XDK with CrossWalk and it works with WebRTC well, but the problem is that it is a pure HTML, Javascript application. I suppose the capability of HTML5 application in android would be a problem? (Notification, service, communication with database). So what I am thinking is that maybe I can build a hybrid application with the framework of a native application and a WebView with it? Thanks in advance, that would help me a lot.
Yes, it is possible. I build this HTML5 , https://www.noupei.com/. Its fully HTML5, build using jQuery and jQuery Mobile. One of my college easily transpose it using a webview for android, https://play.google.com/store/apps/details?id=com.knowledge7.android.noupei
BUT
It is also possible to completely develop your whole application using HTML5, and then package it with something like phonegap, the advantage you have is that using something like phonegap allows you to access the native features of the Android Device.
For HTML5 technologies like Bootstrap that allows you to make very good mobile interfaces are fully mobile responsive. It is possible to make very beautiful and attractive interfaces as well as you also have very good javascript frameworks like AngularJS.

Does it make sense to use Cordova or PhoneGap for the development of a pure browser-based web application?

At first glimpse Cordova and PhoneGap exist primarily for the use to develop apps to be used on a mobile device. Well, I am not interessted in the developement of native mobile apps.
There exists a webapplication (a cms) of our own and the question is now if a mobile toolkit like Cordova or PhoneGap is able to be of any help to develop parts of our cms functionalities with it in order to be able to support more plattforms.
Does it make sense to use Cordova or PhoneGap for the developement of a pure browser-based web application?
Phonegap (or Cordova as its now called) works by wrapping your webpages in a Webview and giving you access (in JavaScript) to some of the native device functions, such as the Camera, Accelerometer, Contacts etc.
As for whether it will help you depends on if want to make use of any of the native device functions, for example if you think incorporating the Camera (current HTML support for camera is quite spotty) into your web app is of use then you probably should consider it.
Another consideration is how your users will access the applications, with Phonegap it gets packages into a native app and they can just launch it from their home-screen (or however they launch apps on their mobile device), while with a Web App it depends on the device, on iOS you can pin it to your home screen and add some meta tags to make it appear more native like (for example hide the address bar) while on Android as far as I know you can't do that.
Finally consider that with Phonegap it might be more of a pain to debug your application since your HTML/Js is wrapped in a Webview, but as far as I've seen there is no easy way to debug it there.
One other thing I seem to recall reading somewhere that on iOS Apple doesn't give your native applications' Webviews access to the same amount of memory as if it were in safari so the exact sane web application when packaged into a Phonegap application might actually be slower.
To sum up, the benefits of wrapping your application in a Phonegap wrapper are access to native device functions and how your users access your app, if those aren't important (or the cons outweigh the benefits) than it probably isn't worth your while to go that route.
Cordova/Phonegap extend javascript with functionality provided by mobile operating systems. Therefore apps developed with these frameworks must be compiled to the target platform and only embed the HTML etc. in an embedded browser. The extensions need java, objective-c etc. code to run so I don't think that you are able to benefit from this code.
You are forced to write your own mobile device compliant HTML code when using Cordova/Phonegap. There are no neat mobile device ready user interface controls provided by the framework but only access to device specific hardware or software apis like notification etc. is given.
Cordova is just the latest name of PhoneGap. I would not go for that if you just want to build a mobile website. First of all publishing such an app on several online stores (iTunes, Play) is a pain.

Categories

Resources